iphone Programming Glossary: make
How to make a UITextField move up when keyboard is present http://stackoverflow.com/questions/1126726/how-to-make-a-uitextfield-move-up-when-keyboard-is-present to make a UITextField move up when keyboard is present With the iPhone SDK I have a UIView with UITextFields.. contents you have now does not fit in the iPhone screen. If you are adding the scroll view just to make the textfield scroll up when keyboard comes up then it's not needed. For showing the textfields without..
How to develop or migrate apps for iPhone 5 screen resolution? http://stackoverflow.com/questions/12395200/how-to-develop-or-migrate-apps-for-iphone-5-screen-resolution or transition already existing applications to the new screen size What should we keep in mind to make applications universal for both the older displays and the new widescreen aspect ratio iphone ios screen..
Reading ePub format http://stackoverflow.com/questions/1388467/reading-epub-format look like a subset of XHTML 1.1 CSS one to define a manifest that lists all of the files that make up that content OPF which is an XML file one to define how everything is packaged up OEBPS a zip file..
AES Encryption for an NSString on the iPhone http://stackoverflow.com/questions/1400246/aes-encryption-for-an-nsstring-on-the-iphone this post but I've had no luck so far. Apple's CryptoExercise certainly has something but I can't make sense of it... I've seen lots of references to CCCrypt but it's failed in every case I've used it. I.. only for demonstrating the state of the data at various points in a real application it wouldn't make sense to print such values. int main int argc const char argv NSAutoreleasePool pool NSAutoreleasePool..
How to call Objective-C from Javascript? http://stackoverflow.com/questions/1662473/how-to-call-objective-c-from-javascript Call your method in Objective C method using the above... return NO return YES Return YES to make sure regular navigation works as expected. And in Javascript function store event document.location..
How to force NSLocalizedString to use a specific language http://stackoverflow.com/questions/1669645/how-to-force-nslocalizedstring-to-use-a-specific-language @ de @ en @ fr nil forKey @ AppleLanguages NSUserDefaults standardUserDefaults synchronize to make the change immediate This would make German the preferred language for your application with English.. NSUserDefaults standardUserDefaults synchronize to make the change immediate This would make German the preferred language for your application with English and French as fallbacks. You would want..
Is there a documented way to set the iPhone orientation? http://stackoverflow.com/questions/181780/is-there-a-documented-way-to-set-the-iphone-orientation an app where I would like to support device rotation in certain views but other don't particularly make sense in Landscape mode so as I swapping the views out I would like to force the rotation to be set..
EXC_BAD_ACCESS signal received http://stackoverflow.com/questions/327082/exc-bad-access-signal-received it can take a little while before you really internalise the memory management rules unless you make a big point of it. Remember anything you get from an allocation function usually the static alloc method..
Check iPhone iOS Version http://stackoverflow.com/questions/3339722/check-iphone-ios-version TRUE Important Note If for whatever reason you decide that systemVersion is what you want make sure to treat it as an string or you risk truncating the minor revision number eg. 3.1.2 3.1 . share..
Build fat static library (device + simulator) using Xcode and SDK 4+ http://stackoverflow.com/questions/3520977/build-fat-static-library-device-simulator-using-xcode-and-sdk-4 re usable technique that can be done inside Xcode. Some history In 2008 we used to be able to make single static libs that included both sim and device. Apple disabled that. Throughout 2009 we made pairs..
Prefixing property names with an underscore in Objective C [duplicate] http://stackoverflow.com/questions/3521254/prefixing-property-names-with-an-underscore-in-objective-c when you're accessing its backing ivar directly though using the 2.0 dot access to properties does make it more possible. Using the standard message passing syntax makes intent more explicit IMO. @interface.. 2.0 dot access to properties does make it more possible. Using the standard message passing syntax makes intent more explicit IMO. @interface Foo NSObject NSNumber bar @property readwrite retain NSNumber..
iOS UIImagePickerController result image orientation after upload http://stackoverflow.com/questions/5427656/ios-uiimagepickercontroller-result-image-orientation-after-upload degrees. my application is set to only work in portrait modes upsidedown and regular . How can i make the image always show the correct orientation after uploading the image appears to be correct as displayed.. UIImageOrientationUp return self We need to calculate the proper transformation to make the image upright. We do it in 2 steps Rotate if Left Right Down and then flip if Mirrored. CGAffineTransform..
iPhone/iOS JSON parsing tutorial [closed] http://stackoverflow.com/questions/5813077/iphone-ios-json-parsing-tutorial iOS JSON parsing tutorial closed As a learning experience I want to make an iphone application that calls a webserver webservice retrieves a JSON response and uses that response..
What is the best way to deal with the NSDateFormatter locale “feature”? http://stackoverflow.com/questions/6613110/what-is-the-best-way-to-deal-with-the-nsdateformatter-locale-feature 44 43.380 DemoApp 160 307 date3 null 2011 07 11 17 44 43.392 DemoApp 160 307 date4 null The phone make that an iPod Touch is set to Great Britain with the 12 24 switch set to 12. There's a clear difference.. extend the bounty deadline for another day or two. Bounty ends in 21 hours it'll go to whoever makes the most effort to help even if the answer isn't really useful in my case. A curious observation Modified..
performSelector may cause a leak because its selector is unknown http://stackoverflow.com/questions/7017281/performselector-may-cause-a-leak-because-its-selector-is-unknown all of the information about the selector and the object during compilation. It doesn't need to make any assumptions about anything. I checked this a year a so ago by looking at the source but don't have..
Reducing piracy of iPhone applications http://stackoverflow.com/questions/846309/reducing-piracy-of-iphone-applications of the App Store applications we build so checking for nil then performing set instructions should make it more difficult for crackers and pirates. I can't take credit for this so please visit How to Thwart..
UIScrollView horizontal paging like Mobile Safari tabs http://stackoverflow.com/questions/1220354/uiscrollview-horizontal-paging-like-mobile-safari-tabs its frame width or height . So the first step is to figure out how wide you want your pages to be. Make that the width of the UIScrollView . Then set your subview's sizes however big you need them to be and.. would have under normal circumstances. Place the UIScrollView in the center of the ClipView . Make sure the ClipView 's clipsToBounds is set to YES if its width is less than that of its parent view...
Tricks for improving iPhone UITableView scrolling performance? http://stackoverflow.com/questions/1352479/tricks-for-improving-iphone-uitableview-scrolling-performance all costs or if you require the standard accessibility functionality the content view's drawRect Make your UITableViewCell 's layer opaque same goes for the content view if you have one Use the reusableCellIdentifier..
How to get the RGB values for a pixel on an image on the iphone http://stackoverflow.com/questions/144250/how-to-get-the-rgb-values-for-a-pixel-on-an-image-on-the-iphone self.size.height RGBA_8_BIT bytesPerRow colorSpace kCGImageAlphaPremultipliedLast Make sure we have our context if context free pixelData NSLog @ Context not created Draw the image to the.. CFDataGetLength bitmapData Copy image data into allocated buffer CFDataGetBytes bitmapData CFRangeMake 0 CFDataGetLength bitmapData pixelByteData Cast a pointer to the first element of pixelByteData Essentially..
Custom Delete button On Editing in UITableView Cell http://stackoverflow.com/questions/1615469/custom-delete-button-on-editing-in-uitableview-cell of swiping you could use something like ABTableViewCell where you just draw in your own view. Make a custom table view override touchesBegan withEvent and check for touches. Calculate the delta of the..
Do I need to disable NSLog before release Application? http://stackoverflow.com/questions/2025471/do-i-need-to-disable-nslog-before-release-application and under the Debug configuration add a value to Preprocessor Macros value like DEBUG_MODE 1 Make sure you only do this for the Debug configuration and not for Beta or Release versions. Then in a common..
Rounded UIView using CALayers - only some corners - How? http://stackoverflow.com/questions/2264083/rounded-uiview-using-calayers-only-some-corners-how UIImage so I used this code to change it http discussions.apple.com thread.jspa threadID 1683876 Make an iPhone project with the View template. In the view controller add this void viewDidLoad CGRect rect.. project with the View template. In the view controller add this void viewDidLoad CGRect rect CGRectMake 10 10 200 100 MyView myView MyView alloc initWithFrame rect self.view addSubview myView super viewDidLoad.. w h 8 4 w colorSpace kCGImageAlphaPremultipliedFirst CGContextBeginPath context CGRect rect CGRectMake 0 0 w h addRoundedRectToPath context rect 50 1 CGContextClosePath context CGContextClip context CGContextDrawImage..
How to store custom objects in NSUserDefaults http://stackoverflow.com/questions/2315948/how-to-store-custom-objects-in-nsuserdefaults check to see if some things exist int startup prefs integerForKey @ appHasLaunched if startup nil Make the single player Player singlePlayer Player alloc init NSLog NSString alloc initWithFormat @ @ n d..
How To Make iPhone App compatible with multiple SDK (firmware) versions http://stackoverflow.com/questions/3027120/how-to-make-iphone-app-compatible-with-multiple-sdk-firmware-versions To Make iPhone App compatible with multiple SDK firmware versions With iOS4 coming out soon I have already..
How to distribute ios application wirelessly without managing UDIDs and recompilation http://stackoverflow.com/questions/5546581/how-to-distribute-ios-application-wirelessly-without-managing-udids-and-recompil File Code Signing Entitlements and before you distribute you have to change Can be debugged to NO Make sure your project is set up with the correct Code signing profiles. Now go to Product archive then with..
Make movie file with picture Array and song file, using AVAsset http://stackoverflow.com/questions/6061092/make-movie-file-with-picture-array-and-song-file-using-avasset movie file with picture Array and song file using AVAsset I'm trying to make movie file using a picture.. printf appending d attemp d n frameCount j CMTime frameTime CMTimeMake frameCount int32_t 10 CVPixelBufferPoolCreatePixelBuffer kCFAllocatorDefault adaptor.pixelBufferPool.. printf appending d attemp d n frameCount j CMTime frameTime CMTimeMake frameCount int32_t 10 append_ok adaptor appendPixelBuffer buffer withPresentationTime frameTime CVPixelBufferPoolRef..
Locking the Fields in MFMailComposeViewController http://stackoverflow.com/questions/6284599/locking-the-fields-in-mfmailcomposeviewcontroller drive.. . Its already in the code but I didnt add it from code. So youll have to add it in IB. 1. Make sure to add the framework you downloaded to your project. 2. Make sure to add the CFNetwork framework.. youll have to add it in IB. 1. Make sure to add the framework you downloaded to your project. 2. Make sure to add the CFNetwork framework to your project 3. Make sure to attach the UILabel name loadingLabel.. you downloaded to your project. 2. Make sure to add the CFNetwork framework to your project 3. Make sure to attach the UILabel name loadingLabel in interface builder 4. The username and password that..
canonical way to randomize an NSArray in Objective C http://stackoverflow.com/questions/791232/canonical-way-to-randomize-an-nsarray-in-objective-c count i 1 i NSUInteger j random_below i self exchangeObjectAtIndex i 1 withObjectAtIndex j @end Make sure you seed the random number generator with e.g. srandom time NULL sometime before you call it otherwise..
Animate change of view controllers without using navigation controller stack, subviews or modal controllers? http://stackoverflow.com/questions/8146253/animate-change-of-view-controllers-without-using-navigation-controller-stack-su to work differently the key point is the animated transition and the single view controller. Make sure you don't retain a view controller anywhere outside of assigning it to window.rootViewController..
Transforming a rectangle image into a quadrilateral using a CATransform3D http://stackoverflow.com/questions/9470493/transforming-a-rectangle-image-into-a-quadrilateral-using-a-catransform3d this question I've created a kit for doing this on iOS https github.com hfossli AGGeometryKit Make sure your anchor point is top left CGPointZero . CATransform3D rectToQuad CGRect rect quadTL CGPoint..
How to make a UITextField move up when keyboard is present http://stackoverflow.com/questions/1126726/how-to-make-a-uitextfield-move-up-when-keyboard-is-present to make a UITextField move up when keyboard is present With the iPhone SDK I have a UIView with UITextFields that brings up a keyboard. I need it to be able to Allow scrolling.. improve this question You will need a scroll view if the contents you have now does not fit in the iPhone screen. If you are adding the scroll view just to make the textfield scroll up when keyboard comes up then it's not needed. For showing the textfields without being hidden by the keyboard the standard way is to move..
How to develop or migrate apps for iPhone 5 screen resolution? http://stackoverflow.com/questions/12395200/how-to-develop-or-migrate-apps-for-iphone-5-screen-resolution 640 x 1136 pixels . What is required to develop new or transition already existing applications to the new screen size What should we keep in mind to make applications universal for both the older displays and the new widescreen aspect ratio iphone ios screen resolution iphone 5 share improve this question Download..
Reading ePub format http://stackoverflow.com/questions/1388467/reading-epub-format formats one to say what the content of the book should look like a subset of XHTML 1.1 CSS one to define a manifest that lists all of the files that make up that content OPF which is an XML file one to define how everything is packaged up OEBPS a zip file of everything in the manifest plus a few extra files The specs..
AES Encryption for an NSString on the iPhone http://stackoverflow.com/questions/1400246/aes-encryption-for-an-nsstring-on-the-iphone I've tried the technique detailed in the first comment on this post but I've had no luck so far. Apple's CryptoExercise certainly has something but I can't make sense of it... I've seen lots of references to CCCrypt but it's failed in every case I've used it. I would also have to be able to decrypt an encrypted string but.. you can write something like this Note The printf calls are only for demonstrating the state of the data at various points in a real application it wouldn't make sense to print such values. int main int argc const char argv NSAutoreleasePool pool NSAutoreleasePool alloc init NSString key @ my password NSString secret @ text..
How to call Objective-C from Javascript? http://stackoverflow.com/questions/1662473/how-to-call-objective-c-from-javascript code to open the Store NSLog components objectAtIndex 3 param2 Call your method in Objective C method using the above... return NO return YES Return YES to make sure regular navigation works as expected. And in Javascript function store event document.location myapp myfunction param1 param2 But nothing happens. iphone..
How to force NSLocalizedString to use a specific language http://stackoverflow.com/questions/1669645/how-to-force-nslocalizedstring-to-use-a-specific-language standardUserDefaults setObject NSArray arrayWithObjects @ de @ en @ fr nil forKey @ AppleLanguages NSUserDefaults standardUserDefaults synchronize to make the change immediate This would make German the preferred language for your application with English and French as fallbacks. You would want to call this sometime.. NSArray arrayWithObjects @ de @ en @ fr nil forKey @ AppleLanguages NSUserDefaults standardUserDefaults synchronize to make the change immediate This would make German the preferred language for your application with English and French as fallbacks. You would want to call this sometime early in your application's startup...
Is there a documented way to set the iPhone orientation? http://stackoverflow.com/questions/181780/is-there-a-documented-way-to-set-the-iphone-orientation a documented way to set the iPhone orientation I have an app where I would like to support device rotation in certain views but other don't particularly make sense in Landscape mode so as I swapping the views out I would like to force the rotation to be set to portrait. There is an undocumented property setter on UIDevice..
EXC_BAD_ACCESS signal received http://stackoverflow.com/questions/327082/exc-bad-access-signal-received Objective C in general. If you've come from another background it can take a little while before you really internalise the memory management rules unless you make a big point of it. Remember anything you get from an allocation function usually the static alloc method but there are a few others or a copy method you own the..
Check iPhone iOS Version http://stackoverflow.com/questions/3339722/check-iphone-ios-version
Build fat static library (device + simulator) using Xcode and SDK 4+ http://stackoverflow.com/questions/3520977/build-fat-static-library-device-simulator-using-xcode-and-sdk-4 are NOT configured to do this. I'm looking for a simple portable re usable technique that can be done inside Xcode. Some history In 2008 we used to be able to make single static libs that included both sim and device. Apple disabled that. Throughout 2009 we made pairs of static libs one for sim one for device. Apple has now..
Prefixing property names with an underscore in Objective C [duplicate] http://stackoverflow.com/questions/3521254/prefixing-property-names-with-an-underscore-in-objective-c it's hard to confuse when you're accessing a property or when you're accessing its backing ivar directly though using the 2.0 dot access to properties does make it more possible. Using the standard message passing syntax makes intent more explicit IMO. @interface Foo NSObject NSNumber bar @property readwrite retain NSNumber.. you're accessing its backing ivar directly though using the 2.0 dot access to properties does make it more possible. Using the standard message passing syntax makes intent more explicit IMO. @interface Foo NSObject NSNumber bar @property readwrite retain NSNumber bar @end @implementation Foo @synthesize bar void baz NSNumber..
iOS UIImagePickerController result image orientation after upload http://stackoverflow.com/questions/5427656/ios-uiimagepickercontroller-result-image-orientation-after-upload the image is uploaded and viewed as it had been rotated 90 degrees. my application is set to only work in portrait modes upsidedown and regular . How can i make the image always show the correct orientation after uploading the image appears to be correct as displayed in an UIImageView directly after taking the picture but.. No op if the orientation is already correct if self.imageOrientation UIImageOrientationUp return self We need to calculate the proper transformation to make the image upright. We do it in 2 steps Rotate if Left Right Down and then flip if Mirrored. CGAffineTransform transform CGAffineTransformIdentity switch self.imageOrientation..
iPhone/iOS JSON parsing tutorial [closed] http://stackoverflow.com/questions/5813077/iphone-ios-json-parsing-tutorial iOS JSON parsing tutorial closed As a learning experience I want to make an iphone application that calls a webserver webservice retrieves a JSON response and uses that response to populate the rows of a UITableView assuming it converts..
What is the best way to deal with the NSDateFormatter locale “feature”? http://stackoverflow.com/questions/6613110/what-is-the-best-way-to-deal-with-the-nsdateformatter-locale-feature 160 307 date2 2001 05 06 03 34 56 AM 0000 2011 07 11 17 44 43.380 DemoApp 160 307 date3 null 2011 07 11 17 44 43.392 DemoApp 160 307 date4 null The phone make that an iPod Touch is set to Great Britain with the 12 24 switch set to 12. There's a clear difference in the two results and I judge the category version to be.. update Since I haven't gotten any applicable replies yet I'll extend the bounty deadline for another day or two. Bounty ends in 21 hours it'll go to whoever makes the most effort to help even if the answer isn't really useful in my case. A curious observation Modified the category implementation slightly #import NSDateFormatter..
performSelector may cause a leak because its selector is unknown http://stackoverflow.com/questions/7017281/performselector-may-cause-a-leak-because-its-selector-is-unknown for this is because the compiler actually is able to record all of the information about the selector and the object during compilation. It doesn't need to make any assumptions about anything. I checked this a year a so ago by looking at the source but don't have a reference right now. Suppression In trying to think of..
Reducing piracy of iPhone applications http://stackoverflow.com/questions/846309/reducing-piracy-of-iphone-applications do something Generally we don't have SignerIdentity in any of the App Store applications we build so checking for nil then performing set instructions should make it more difficult for crackers and pirates. I can't take credit for this so please visit How to Thwart iPhone IPA Crackers. There's loads of information there about..
UIScrollView horizontal paging like Mobile Safari tabs http://stackoverflow.com/questions/1220354/uiscrollview-horizontal-paging-like-mobile-safari-tabs UIScrollView with paging enabled will stop at multiples of its frame width or height . So the first step is to figure out how wide you want your pages to be. Make that the width of the UIScrollView . Then set your subview's sizes however big you need them to be and set their centers based on multiples of the UIScrollView.. should have the frame of what you would assume the UIScrollView would have under normal circumstances. Place the UIScrollView in the center of the ClipView . Make sure the ClipView 's clipsToBounds is set to YES if its width is less than that of its parent view. Also the ClipView needs a reference to the UIScrollView . The..
Tricks for improving iPhone UITableView scrolling performance? http://stackoverflow.com/questions/1352479/tricks-for-improving-iphone-uitableview-scrolling-performance the UITableViewCell 's drawRect if possible avoid subviews at all costs or if you require the standard accessibility functionality the content view's drawRect Make your UITableViewCell 's layer opaque same goes for the content view if you have one Use the reusableCellIdentifier functionality as recommended by the UITableView..
How to get the RGB values for a pixel on an image on the iphone http://stackoverflow.com/questions/144250/how-to-get-the-rgb-values-for-a-pixel-on-an-image-on-the-iphone CGBitmapContextCreate void pixelData self.size.width self.size.height RGBA_8_BIT bytesPerRow colorSpace kCGImageAlphaPremultipliedLast Make sure we have our context if context free pixelData NSLog @ Context not created Draw the image to the bitmap context. The memory allocated for the context for rendering.. memory as long as the data self setPixelBitData malloc CFDataGetLength bitmapData Copy image data into allocated buffer CFDataGetBytes bitmapData CFRangeMake 0 CFDataGetLength bitmapData pixelByteData Cast a pointer to the first element of pixelByteData Essentially what we're doing is making a second pointer that divides..
Custom Delete button On Editing in UITableView Cell http://stackoverflow.com/questions/1615469/custom-delete-button-on-editing-in-uitableview-cell something like Tweetie where you completely change the behavior of swiping you could use something like ABTableViewCell where you just draw in your own view. Make a custom table view override touchesBegan withEvent and check for touches. Calculate the delta of the two touches in touchesMoved withEvent and move your own view..
Do I need to disable NSLog before release Application? http://stackoverflow.com/questions/2025471/do-i-need-to-disable-nslog-before-release-application question One way to do it is to go into your Build settings and under the Debug configuration add a value to Preprocessor Macros value like DEBUG_MODE 1 Make sure you only do this for the Debug configuration and not for Beta or Release versions. Then in a common header file you can do something like #ifdef DEBUG_MODE..
Rounded UIView using CALayers - only some corners - How? http://stackoverflow.com/questions/2264083/rounded-uiview-using-calayers-only-some-corners-how answered the wrong question gave a rounded UILabel instead of UIImage so I used this code to change it http discussions.apple.com thread.jspa threadID 1683876 Make an iPhone project with the View template. In the view controller add this void viewDidLoad CGRect rect CGRectMake 10 10 200 100 MyView myView MyView alloc initWithFrame.. thread.jspa threadID 1683876 Make an iPhone project with the View template. In the view controller add this void viewDidLoad CGRect rect CGRectMake 10 10 200 100 MyView myView MyView alloc initWithFrame rect self.view addSubview myView super viewDidLoad MyView is just a UIImageView subclass @interface MyView.. CGContextRef context CGBitmapContextCreate NULL w h 8 4 w colorSpace kCGImageAlphaPremultipliedFirst CGContextBeginPath context CGRect rect CGRectMake 0 0 w h addRoundedRectToPath context rect 50 1 CGContextClosePath context CGContextClip context CGContextDrawImage context rect img.CGImage CGImageRef imageMasked..
How to store custom objects in NSUserDefaults http://stackoverflow.com/questions/2315948/how-to-store-custom-objects-in-nsuserdefaults prefs NSUserDefaults standardUserDefaults First check to see if some things exist int startup prefs integerForKey @ appHasLaunched if startup nil Make the single player Player singlePlayer Player alloc init NSLog NSString alloc initWithFormat @ @ n d n d singlePlayer name singlePlayer life singlePlayer psnCounters..
How To Make iPhone App compatible with multiple SDK (firmware) versions http://stackoverflow.com/questions/3027120/how-to-make-iphone-app-compatible-with-multiple-sdk-firmware-versions To Make iPhone App compatible with multiple SDK firmware versions With iOS4 coming out soon I have already planned to include an iAd in a future update of an app of mine...
How to distribute ios application wirelessly without managing UDIDs and recompilation http://stackoverflow.com/questions/5546581/how-to-distribute-ios-application-wirelessly-without-managing-udids-and-recompil have to add an Entitlements.plist file to your resources New File Code Signing Entitlements and before you distribute you have to change Can be debugged to NO Make sure your project is set up with the correct Code signing profiles. Now go to Product archive then with your newly built entry click on Share Select iOS App Store..
Make movie file with picture Array and song file, using AVAsset http://stackoverflow.com/questions/6061092/make-movie-file-with-picture-array-and-song-file-using-avasset movie file with picture Array and song file using AVAsset I'm trying to make movie file using a picture array and an audio file. To make movie with a picture array.. NO int j 0 while append_ok j 30 if adaptor.assetWriterInput.readyForMoreMediaData printf appending d attemp d n frameCount j CMTime frameTime CMTimeMake frameCount int32_t 10 CVPixelBufferPoolCreatePixelBuffer kCFAllocatorDefault adaptor.pixelBufferPool buffer append_ok adaptor appendPixelBuffer buffer withPresentationTime.. NO int j 0 while append_ok j 30 if adaptor.assetWriterInput.readyForMoreMediaData printf appending d attemp d n frameCount j CMTime frameTime CMTimeMake frameCount int32_t 10 append_ok adaptor appendPixelBuffer buffer withPresentationTime frameTime CVPixelBufferPoolRef bufferPool adaptor.pixelBufferPool NSParameterAssert..
Locking the Fields in MFMailComposeViewController http://stackoverflow.com/questions/6284599/locking-the-fields-in-mfmailcomposeviewcontroller builder and create the label though that says sending test drive.. . Its already in the code but I didnt add it from code. So youll have to add it in IB. 1. Make sure to add the framework you downloaded to your project. 2. Make sure to add the CFNetwork framework to your project 3. Make sure to attach the UILabel name loadingLabel.. . Its already in the code but I didnt add it from code. So youll have to add it in IB. 1. Make sure to add the framework you downloaded to your project. 2. Make sure to add the CFNetwork framework to your project 3. Make sure to attach the UILabel name loadingLabel in interface builder 4. The username and password that.. youll have to add it in IB. 1. Make sure to add the framework you downloaded to your project. 2. Make sure to add the CFNetwork framework to your project 3. Make sure to attach the UILabel name loadingLabel in interface builder 4. The username and password that the code is refering to is an smtp server. If you dont have..
canonical way to randomize an NSArray in Objective C http://stackoverflow.com/questions/791232/canonical-way-to-randomize-an-nsarray-in-objective-c http en.wikipedia.org wiki Knuth_shuffle for NSUInteger i self count i 1 i NSUInteger j random_below i self exchangeObjectAtIndex i 1 withObjectAtIndex j @end Make sure you seed the random number generator with e.g. srandom time NULL sometime before you call it otherwise the output won't be very random. share improve this..
Animate change of view controllers without using navigation controller stack, subviews or modal controllers? http://stackoverflow.com/questions/8146253/animate-change-of-view-controllers-without-using-navigation-controller-stack-su is alive e.g. alloc'ed . The code can be easily modified to work differently the key point is the animated transition and the single view controller. Make sure you don't retain a view controller anywhere outside of assigning it to window.rootViewController . Code to animate transition in app delegate void transitionToViewController..
Transforming a rectangle image into a quadrilateral using a CATransform3D http://stackoverflow.com/questions/9470493/transforming-a-rectangle-image-into-a-quadrilateral-using-a-catransform3d iphone ios cocoa touch math core animation share improve this question I've created a kit for doing this on iOS https github.com hfossli AGGeometryKit Make sure your anchor point is top left CGPointZero . CATransform3D rectToQuad CGRect rect quadTL CGPoint topLeft quadTR CGPoint topRight quadBL CGPoint bottomLeft..
How to make a UITextField move up when keyboard is present http://stackoverflow.com/questions/1126726/how-to-make-a-uitextfield-move-up-when-keyboard-is-present to make a UITextField move up when keyboard is present With the iPhone SDK I have a UIView with UITextFields that brings up a keyboard... scroll view if the contents you have now does not fit in the iPhone screen. If you are adding the scroll view just to make the textfield scroll up when keyboard comes up then it's not needed. For showing the textfields without being hidden by..
How to develop or migrate apps for iPhone 5 screen resolution? http://stackoverflow.com/questions/12395200/how-to-develop-or-migrate-apps-for-iphone-5-screen-resolution to develop new or transition already existing applications to the new screen size What should we keep in mind to make applications universal for both the older displays and the new widescreen aspect ratio iphone ios screen resolution iphone..
Reading ePub format http://stackoverflow.com/questions/1388467/reading-epub-format of the book should look like a subset of XHTML 1.1 CSS one to define a manifest that lists all of the files that make up that content OPF which is an XML file one to define how everything is packaged up OEBPS a zip file of everything in the..
AES Encryption for an NSString on the iPhone http://stackoverflow.com/questions/1400246/aes-encryption-for-an-nsstring-on-the-iphone the first comment on this post but I've had no luck so far. Apple's CryptoExercise certainly has something but I can't make sense of it... I've seen lots of references to CCCrypt but it's failed in every case I've used it. I would also have to.. The printf calls are only for demonstrating the state of the data at various points in a real application it wouldn't make sense to print such values. int main int argc const char argv NSAutoreleasePool pool NSAutoreleasePool alloc init NSString..
How to call Objective-C from Javascript? http://stackoverflow.com/questions/1662473/how-to-call-objective-c-from-javascript objectAtIndex 3 param2 Call your method in Objective C method using the above... return NO return YES Return YES to make sure regular navigation works as expected. And in Javascript function store event document.location myapp myfunction param1..
How to force NSLocalizedString to use a specific language http://stackoverflow.com/questions/1669645/how-to-force-nslocalizedstring-to-use-a-specific-language NSArray arrayWithObjects @ de @ en @ fr nil forKey @ AppleLanguages NSUserDefaults standardUserDefaults synchronize to make the change immediate This would make German the preferred language for your application with English and French as fallbacks... fr nil forKey @ AppleLanguages NSUserDefaults standardUserDefaults synchronize to make the change immediate This would make German the preferred language for your application with English and French as fallbacks. You would want to call this sometime..
Is there a documented way to set the iPhone orientation? http://stackoverflow.com/questions/181780/is-there-a-documented-way-to-set-the-iphone-orientation orientation I have an app where I would like to support device rotation in certain views but other don't particularly make sense in Landscape mode so as I swapping the views out I would like to force the rotation to be set to portrait. There is..
EXC_BAD_ACCESS signal received http://stackoverflow.com/questions/327082/exc-bad-access-signal-received another background it can take a little while before you really internalise the memory management rules unless you make a big point of it. Remember anything you get from an allocation function usually the static alloc method but there are a..
Check iPhone iOS Version http://stackoverflow.com/questions/3339722/check-iphone-ios-version displayLinkSupported TRUE Important Note If for whatever reason you decide that systemVersion is what you want make sure to treat it as an string or you risk truncating the minor revision number eg. 3.1.2 3.1 . share improve this answer..
Build fat static library (device + simulator) using Xcode and SDK 4+ http://stackoverflow.com/questions/3520977/build-fat-static-library-device-simulator-using-xcode-and-sdk-4 for a simple portable re usable technique that can be done inside Xcode. Some history In 2008 we used to be able to make single static libs that included both sim and device. Apple disabled that. Throughout 2009 we made pairs of static libs..
Prefixing property names with an underscore in Objective C [duplicate] http://stackoverflow.com/questions/3521254/prefixing-property-names-with-an-underscore-in-objective-c a property or when you're accessing its backing ivar directly though using the 2.0 dot access to properties does make it more possible. Using the standard message passing syntax makes intent more explicit IMO. @interface Foo NSObject NSNumber.. though using the 2.0 dot access to properties does make it more possible. Using the standard message passing syntax makes intent more explicit IMO. @interface Foo NSObject NSNumber bar @property readwrite retain NSNumber bar @end @implementation..
iOS UIImagePickerController result image orientation after upload http://stackoverflow.com/questions/5427656/ios-uiimagepickercontroller-result-image-orientation-after-upload had been rotated 90 degrees. my application is set to only work in portrait modes upsidedown and regular . How can i make the image always show the correct orientation after uploading the image appears to be correct as displayed in an UIImageView.. correct if self.imageOrientation UIImageOrientationUp return self We need to calculate the proper transformation to make the image upright. We do it in 2 steps Rotate if Left Right Down and then flip if Mirrored. CGAffineTransform transform..
iPhone/iOS JSON parsing tutorial [closed] http://stackoverflow.com/questions/5813077/iphone-ios-json-parsing-tutorial iOS JSON parsing tutorial closed As a learning experience I want to make an iphone application that calls a webserver webservice retrieves a JSON response and uses that response to populate the..
What is the best way to deal with the NSDateFormatter locale “feature”? http://stackoverflow.com/questions/6613110/what-is-the-best-way-to-deal-with-the-nsdateformatter-locale-feature 0000 2011 07 11 17 44 43.380 DemoApp 160 307 date3 null 2011 07 11 17 44 43.392 DemoApp 160 307 date4 null The phone make that an iPod Touch is set to Great Britain with the 12 24 switch set to 12. There's a clear difference in the two results.. replies yet I'll extend the bounty deadline for another day or two. Bounty ends in 21 hours it'll go to whoever makes the most effort to help even if the answer isn't really useful in my case. A curious observation Modified the category..
performSelector may cause a leak because its selector is unknown http://stackoverflow.com/questions/7017281/performselector-may-cause-a-leak-because-its-selector-is-unknown is able to record all of the information about the selector and the object during compilation. It doesn't need to make any assumptions about anything. I checked this a year a so ago by looking at the source but don't have a reference right..
Reducing piracy of iPhone applications http://stackoverflow.com/questions/846309/reducing-piracy-of-iphone-applications in any of the App Store applications we build so checking for nil then performing set instructions should make it more difficult for crackers and pirates. I can't take credit for this so please visit How to Thwart iPhone IPA Crackers...
UIScrollView horizontal paging like Mobile Safari tabs http://stackoverflow.com/questions/1220354/uiscrollview-horizontal-paging-like-mobile-safari-tabs at multiples of its frame width or height . So the first step is to figure out how wide you want your pages to be. Make that the width of the UIScrollView . Then set your subview's sizes however big you need them to be and set their centers.. assume the UIScrollView would have under normal circumstances. Place the UIScrollView in the center of the ClipView . Make sure the ClipView 's clipsToBounds is set to YES if its width is less than that of its parent view. Also the ClipView needs..
Tricks for improving iPhone UITableView scrolling performance? http://stackoverflow.com/questions/1352479/tricks-for-improving-iphone-uitableview-scrolling-performance avoid subviews at all costs or if you require the standard accessibility functionality the content view's drawRect Make your UITableViewCell 's layer opaque same goes for the content view if you have one Use the reusableCellIdentifier functionality..
How to get the RGB values for a pixel on an image on the iphone http://stackoverflow.com/questions/144250/how-to-get-the-rgb-values-for-a-pixel-on-an-image-on-the-iphone self.size.width self.size.height RGBA_8_BIT bytesPerRow colorSpace kCGImageAlphaPremultipliedLast Make sure we have our context if context free pixelData NSLog @ Context not created Draw the image to the bitmap context. The.. malloc CFDataGetLength bitmapData Copy image data into allocated buffer CFDataGetBytes bitmapData CFRangeMake 0 CFDataGetLength bitmapData pixelByteData Cast a pointer to the first element of pixelByteData Essentially what we're doing..
Custom Delete button On Editing in UITableView Cell http://stackoverflow.com/questions/1615469/custom-delete-button-on-editing-in-uitableview-cell change the behavior of swiping you could use something like ABTableViewCell where you just draw in your own view. Make a custom table view override touchesBegan withEvent and check for touches. Calculate the delta of the two touches in touchesMoved..
Do I need to disable NSLog before release Application? http://stackoverflow.com/questions/2025471/do-i-need-to-disable-nslog-before-release-application into your Build settings and under the Debug configuration add a value to Preprocessor Macros value like DEBUG_MODE 1 Make sure you only do this for the Debug configuration and not for Beta or Release versions. Then in a common header file you..
Rounded UIView using CALayers - only some corners - How? http://stackoverflow.com/questions/2264083/rounded-uiview-using-calayers-only-some-corners-how UILabel instead of UIImage so I used this code to change it http discussions.apple.com thread.jspa threadID 1683876 Make an iPhone project with the View template. In the view controller add this void viewDidLoad CGRect rect CGRectMake 10 10.. Make an iPhone project with the View template. In the view controller add this void viewDidLoad CGRect rect CGRectMake 10 10 200 100 MyView myView MyView alloc initWithFrame rect self.view addSubview myView super viewDidLoad MyView is just.. NULL w h 8 4 w colorSpace kCGImageAlphaPremultipliedFirst CGContextBeginPath context CGRect rect CGRectMake 0 0 w h addRoundedRectToPath context rect 50 1 CGContextClosePath context CGContextClip context CGContextDrawImage context..
How to store custom objects in NSUserDefaults http://stackoverflow.com/questions/2315948/how-to-store-custom-objects-in-nsuserdefaults First check to see if some things exist int startup prefs integerForKey @ appHasLaunched if startup nil Make the single player Player singlePlayer Player alloc init NSLog NSString alloc initWithFormat @ @ n d n d singlePlayer name..
unrecognized selector sent to instance http://stackoverflow.com/questions/2455161/unrecognized-selector-sent-to-instance bundle nibBundleOrNil UIButton numberButton UIButton buttonWithType UIButtonTypeCustom numberButton.frame CGRectMake 10 435 46 38 numberButton setImage UIImage imageNamed @ one.png forState UIControlStateNormal numberButton addTarget self..
shouldAutorotateToInterfaceOrientation doesn't work http://stackoverflow.com/questions/2868132/shouldautorotatetointerfaceorientation-doesnt-work to work. Appriciate your help. iphone xcode ipad uiviewcontroller screen orientation share improve this question Make sure all of your parent views have autoresizesSubviews YES. You may need to do this in code if you haven't set springs and..
How To Make iPhone App compatible with multiple SDK (firmware) versions http://stackoverflow.com/questions/3027120/how-to-make-iphone-app-compatible-with-multiple-sdk-firmware-versions To Make iPhone App compatible with multiple SDK firmware versions With iOS4 coming out soon I have already planned to include an..
How to distribute ios application wirelessly without managing UDIDs and recompilation http://stackoverflow.com/questions/5546581/how-to-distribute-ios-application-wirelessly-without-managing-udids-and-recompil your resources New File Code Signing Entitlements and before you distribute you have to change Can be debugged to NO Make sure your project is set up with the correct Code signing profiles. Now go to Product archive then with your newly built..
Make movie file with picture Array and song file, using AVAsset http://stackoverflow.com/questions/6061092/make-movie-file-with-picture-array-and-song-file-using-avasset movie file with picture Array and song file using AVAsset I'm trying to make movie file using a picture array and an audio.. if adaptor.assetWriterInput.readyForMoreMediaData printf appending d attemp d n frameCount j CMTime frameTime CMTimeMake frameCount int32_t 10 CVPixelBufferPoolCreatePixelBuffer kCFAllocatorDefault adaptor.pixelBufferPool buffer append_ok.. if adaptor.assetWriterInput.readyForMoreMediaData printf appending d attemp d n frameCount j CMTime frameTime CMTimeMake frameCount int32_t 10 append_ok adaptor appendPixelBuffer buffer withPresentationTime frameTime CVPixelBufferPoolRef bufferPool..
Locking the Fields in MFMailComposeViewController http://stackoverflow.com/questions/6284599/locking-the-fields-in-mfmailcomposeviewcontroller says sending test drive.. . Its already in the code but I didnt add it from code. So youll have to add it in IB. 1. Make sure to add the framework you downloaded to your project. 2. Make sure to add the CFNetwork framework to your project 3... add it from code. So youll have to add it in IB. 1. Make sure to add the framework you downloaded to your project. 2. Make sure to add the CFNetwork framework to your project 3. Make sure to attach the UILabel name loadingLabel in interface builder.. to add the framework you downloaded to your project. 2. Make sure to add the CFNetwork framework to your project 3. Make sure to attach the UILabel name loadingLabel in interface builder 4. The username and password that the code is refering..
canonical way to randomize an NSArray in Objective C http://stackoverflow.com/questions/791232/canonical-way-to-randomize-an-nsarray-in-objective-c for NSUInteger i self count i 1 i NSUInteger j random_below i self exchangeObjectAtIndex i 1 withObjectAtIndex j @end Make sure you seed the random number generator with e.g. srandom time NULL sometime before you call it otherwise the output won't..
Animate change of view controllers without using navigation controller stack, subviews or modal controllers? http://stackoverflow.com/questions/8146253/animate-change-of-view-controllers-without-using-navigation-controller-stack-su can be easily modified to work differently the key point is the animated transition and the single view controller. Make sure you don't retain a view controller anywhere outside of assigning it to window.rootViewController . Code to animate..
Secure https encryption for iPhone app to webpage http://stackoverflow.com/questions/9181186/secure-https-encryption-for-iphone-app-to-webpage watching for new attacks and responding with fixes that patch them. The latter is very expensive and never ends. Make sure it's worth it. Some other useful discussions Anti piracy and app identification. iPhone SDK Easiest way to limit executable..
Transforming a rectangle image into a quadrilateral using a CATransform3D http://stackoverflow.com/questions/9470493/transforming-a-rectangle-image-into-a-quadrilateral-using-a-catransform3d share improve this question I've created a kit for doing this on iOS https github.com hfossli AGGeometryKit Make sure your anchor point is top left CGPointZero . CATransform3D rectToQuad CGRect rect quadTL CGPoint topLeft quadTR CGPoint..
|