iphone Programming Glossary: yes
How to check for an active Internet Connection on iPhone SDK? http://stackoverflow.com/questions/1083701/how-to-check-for-an-active-internet-connection-on-iphone-sdk NSString stringWithContentsOfURL NSURL URLWithString @ http www.google.com return URLString NULL YES NO Is what I have done bad Not to mention stringWithContentsOfURL is deprecated in 3.0 And if so what.. NO break case ReachableViaWiFi NSLog @ The internet is working via WIFI. self.internetActive YES break case ReachableViaWWAN NSLog @ The internet is working via WWAN. self.internetActive YES break.. YES break case ReachableViaWWAN NSLog @ The internet is working via WWAN. self.internetActive YES break NetworkStatus hostStatus hostReachable currentReachabilityStatus switch hostStatus case NotReachable..
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 Animate the current view out of the way if self.view.frame.origin.y 0 self setViewMovedUp YES else if self.view.frame.origin.y 0 self setViewMovedUp NO void keyboardWillHide if self.view.frame.origin.y.. 0 self setViewMovedUp NO void keyboardWillHide if self.view.frame.origin.y 0 self setViewMovedUp YES else if self.view.frame.origin.y 0 self setViewMovedUp NO void textFieldDidBeginEditing UITextField.. view so that the keyboard does not hide it. if self.view.frame.origin.y 0 self setViewMovedUp YES method to move the view up down whenever the keyboard is shown dismissed void setViewMovedUp BOOL movedUp..
How can I upload a photo to a server with the iPhone? http://stackoverflow.com/questions/125306/how-can-i-upload-a-photo-to-a-server-with-the-iphone NO return if data length 0 There's no data treat this the same as no file. self uploadSucceeded YES return NSData compressedData self compress data ASSERT compressedData compressedData length 0 if compressedData.. didReceiveData Called when we have data from the server. We expect the server to reply with a YES if the upload succeeded or NO if it did not. Results None Side effects None void connection NSURLConnection.. autorelease NSLog @ s data s n __func__ reply UTF8String if reply hasPrefix @ YES uploadDidSucceed YES @end Usage EPUploader alloc initWithURL NSURL URLWithString @ http yourserver.com..
Add UIPickerView & a Button in Action sheet - How? http://stackoverflow.com/questions/1262574/add-uipickerview-a-button-in-action-sheet-how States tableViewController.delegate self self presentViewController navigationController animated YES completion nil I create a simple example and posted it on github . Also see Showing actionsheet causes..
How do I detect when someone shakes an iPhone? http://stackoverflow.com/questions/150446/how-do-i-detect-when-someone-shakes-an-iphone motionEnded withEvent super motionEnded motion withEvent event BOOL canBecomeFirstResponder return YES @end You can easily transform any UIView even system views into a view that can get the shake event..
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.. 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..
How to take a screenshot programmatically http://stackoverflow.com/questions/2200736/how-to-take-a-screenshot-programmatically NSData data UIImagePNGRepresentation image data writeToFile @ foo.png atomically YES UPDATE April 2011 for retina display change the first line into this if UIScreen mainScreen respondsToSelector..
How can I send mail from an iPhone application http://stackoverflow.com/questions/310946/how-can-i-send-mail-from-an-iphone-application @ Hello there. isHTML NO if controller self presentModalViewController controller animated YES controller release Then the user does the work and you get the delegate callback in time void mailComposeController.. error if result MFMailComposeResultSent NSLog @ It's away self dismissModalViewControllerAnimated YES Remember to check if the device is configured for sending email if MFMailComposeViewController canSendMail..
How do I export UIImage array as a movie? http://stackoverflow.com/questions/3741323/how-do-i-export-uiimage-array-as-a-movie image NSDictionary options NSDictionary dictionaryWithObjectsAndKeys NSNumber numberWithBool YES kCVPixelBufferCGImageCompatibilityKey NSNumber numberWithBool YES kCVPixelBufferCGBitmapContextCompatibilityKey.. NSNumber numberWithBool YES kCVPixelBufferCGImageCompatibilityKey NSNumber numberWithBool YES kCVPixelBufferCGBitmapContextCompatibilityKey nil CVPixelBufferRef pxbuffer NULL CVReturn status CVPixelBufferCreate..
Retrieving a pixel alpha value for a UIImage http://stackoverflow.com/questions/1042830/retrieving-a-pixel-alpha-value-for-a-uiimage kCGBlendModeCopy iphone uikit core graphics quartz graphics share improve this question Yes CGContexts have their y axis pointing up while in UIKit it points down. See the docs . Edit after reading..
'Missing recommended icon file - The bundle does not contain an app icon for iPhone / iPod Touch of exactly '120x120' pixels, in .png format' http://stackoverflow.com/questions/18736954/missing-recommended-icon-file-the-bundle-does-not-contain-an-app-icon-for-iph app review people lurk around here. iphone ios ios7 itunes share improve this question Yes you need to add a 120x120 high resolution icon. Now if you want to target only iOS 7 you just need 76..
Objective-C categories in static library http://stackoverflow.com/questions/2567498/objective-c-categories-in-static-library force_load to reduce app binary size and to avoid conflicts wich all_load can cause in some cases. Yes it works with .a files added to the project. Yet I had troubles with lib project added as direct dependency...
Is MonoTouch now banned on the iPhone? [closed] http://stackoverflow.com/questions/2604033/is-monotouch-now-banned-on-the-iphone MonoTouch should no longer conflict with the agreement. Any statements below are purely historical Yes it seems pretty clear from their license agreement now that if the original application is written in..
What are the sizes used for the iOS application splash screen? http://stackoverflow.com/questions/2634898/what-are-the-sizes-used-for-the-ios-application-splash-screen a blog post based on Apple's doco and placed it on my blog . I hope you guys find it useful. Yes. In iPhone iPad development the Default.png file is displayed by the device automatically so you don't..
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 user's firmware Cheers. iphone iphone sdk 3.0 compatibility ios4 share improve this question Yes you can build with the latest SDK ie 5.1 and still run on devices with earlier versions of the firmware..
Install xCode 3.2.3 w/ iPhone SDK 4, get “Base SDK missing”, can't see other SDKs http://stackoverflow.com/questions/3161385/install-xcode-3-2-3-w-iphone-sdk-4-get-base-sdk-missing-cant-see-other-sdk Fun. You can still download from Apple and install a previous Xcode version or SDK cf. here . Yes you can install multiple Xcode versions in different directories i.e. put only one version in Developer...
iPhone App Minus App Store? http://stackoverflow.com/questions/37464/iphone-app-minus-app-store Create a Certificate. Name iPhone Developer Certificate Type Code Signing Let me override defaults Yes Click Continue Validity 3650 days Click Continue Blank out the Email address field. Click Continue until..
iphone/ipad: How exactly use NSAttributedString? http://stackoverflow.com/questions/3786528/iphone-ipad-how-exactly-use-nsattributedstring ipad How exactly use NSAttributedString Yes many people are saying about Rich Text in iphone ipad and many knows about NSAttributedString . But..
Fast and Lean PDF Viewer for iPhone / iPad / iOs - tips and hints? http://stackoverflow.com/questions/3889634/fast-and-lean-pdf-viewer-for-iphone-ipad-ios-tips-and-hints for iPhone iPad iOs tips and hints There has been many Questions recently about drawing PDF's. Yes you can render PDF's very easily with a UIWebView but this cant give the performance and functionality..
How to build a framework or library for other developers, the secure way? http://stackoverflow.com/questions/4065052/how-to-build-a-framework-or-library-for-other-developers-the-secure-way way to obfuscate the objective c code iphone ipad frameworks ios share improve this question Yes it is possible to build frameworks so the user of the framework can't see the source code. Check out..
How to filter NSFetchedResultsController (CoreData) with UISearchDisplayController/UISearchBar http://stackoverflow.com/questions/4471289/how-to-filter-nsfetchedresultscontroller-coredata-with-uisearchdisplaycontroll what to do . I tried Sergio's answer but had exception issues when actually running on a device. Yes you create two fetch results controllers one for the normal display and another one for the UISearchBar's..
iOS download and save image inside app [duplicate] http://stackoverflow.com/questions/6238139/ios-download-and-save-image-inside-app would make a nice feature for my app. iphone cocoa touch ios ipad share improve this question Yes that's possible. Download Create and Display an Image from URL Check the below blog post it's step by..
program access to iPhone volume buttons http://stackoverflow.com/questions/772832/program-access-to-iphone-volume-buttons buttons. There's no other published way currently to handle this. PLEASE READ THE ABOVE NOTE Yes Use the MPVolumeView MPVolumeView volume MPVolumeView alloc initWithFrame CGRectMake 18.0 340.0 284.0..
Programmatically retrieve memory usage on iPhone http://stackoverflow.com/questions/787160/programmatically-retrieve-memory-usage-on-iphone I'm trying to retrieve the amount of memory my iPhone app is using at anytime programmatically. Yes I'm aware about ObjectAlloc Leaks. I'm not interested in those only to know if it's possible to write..
How to get information about free memory and running processes in an App Store approved app? (Yes, there is one!) http://stackoverflow.com/questions/8275578/how-to-get-information-about-free-memory-and-running-processes-in-an-app-store-a to get information about free memory and running processes in an App Store approved app Yes there is one There is an app called Activity Monitor Touch in the App Store which displays background..
Is there a barcode recognition framework for iOS? http://stackoverflow.com/questions/838724/is-there-a-barcode-recognition-framework-for-ios barcode recognition on iPhone iPad iphone ios cocoa touch barcode share improve this question Yes we produced the 'Barcodes' application for the iPhone. It can decode QR Codes. The source code is available..
Is there any ready-made calendar control for iPhone apps? http://stackoverflow.com/questions/997779/is-there-any-ready-made-calendar-control-for-iphone-apps project plans . iphone cocoa touch interface uikit calendar share improve this question Yes. These are the option I am aware of EDIT as of May 6 2010 1 GCCalendar 2 http github.com klazuka Kal..
Declaration/definition of variables locations in ObjectiveC? http://stackoverflow.com/questions/12632285/declaration-definition-of-variables-locations-in-objectivec
Rounded UIView using CALayers - only some corners - How? http://stackoverflow.com/questions/2264083/rounded-uiview-using-calayers-only-some-corners-how to apply roundness to selected corners like top top left bottom right etc. Is it possible IF yes then How Thanks in advance for sharing your knowledge. Sagar. iphone objective c xcode uiview calayer..
Easiest way to support multiple orientations? How do I load a custom NIB when the application is in Landscape? http://stackoverflow.com/questions/2496554/easiest-way-to-support-multiple-orientations-how-do-i-load-a-custom-nib-when-th load another if needed. You check orientation in shouldAutorotateToInterfaceOrientation returning yes if you want to rotate. I use a navigation controller to manage the transition. If I have the portrait..
Objective-C categories in static library http://stackoverflow.com/questions/2567498/objective-c-categories-in-static-library category h m files empty dummy class interface implementation to force linker use this file. And yes this trick do the job. But author also said he even not instantiated dummy object. Mm As I've found..
Is it possible to program iPhone in C++ http://stackoverflow.com/questions/270455/is-it-possible-to-program-iphone-in-c C while using the Cocoa API etc c iphone objective c share improve this question Short answer yes sort of. You can use Objective C which you can read about at Apple Developer Connection. If you know..
Starting iPhone app development in Linux? http://stackoverflow.com/questions/276907/starting-iphone-app-development-in-linux you want to develop iPhone apps. Is this true Is it possible to develop iPhone apps using Linux If yes what do I need and where do I download the necessary tools iphone ios linux share improve this question..
iPhone Facebook Video Upload http://stackoverflow.com/questions/5355846/iphone-facebook-video-upload in the documentation. Most of the time the pull requests simply sit there until rejected. And yes did I mention that the video upload code is a messy hack The video upload code is a messy hack. It parses..
iPhone Data Usage Tracking/Monitoring http://stackoverflow.com/questions/7946699/iphone-data-usage-tracking-monitoring know why but ifi_opackets and ifi_ipackets are shown just for lo0 i think its main interface . yes. Then device is connected via WiFi and doesn't use internet if_iobytes values still come because this..
How to check for an active Internet Connection on iPhone SDK? http://stackoverflow.com/questions/1083701/how-to-check-for-an-active-internet-connection-on-iphone-sdk my application. BOOL connectedToInternet NSString URLString NSString stringWithContentsOfURL NSURL URLWithString @ http www.google.com return URLString NULL YES NO Is what I have done bad Not to mention stringWithContentsOfURL is deprecated in 3.0 And if so what is a better way to accomplish this iphone objective c ios.. NSLog @ The internet is down. self.internetActive NO break case ReachableViaWiFi NSLog @ The internet is working via WIFI. self.internetActive YES break case ReachableViaWWAN NSLog @ The internet is working via WWAN. self.internetActive YES break NetworkStatus hostStatus hostReachable currentReachabilityStatus.. @ The internet is working via WIFI. self.internetActive YES break case ReachableViaWWAN NSLog @ The internet is working via WWAN. self.internetActive YES break NetworkStatus hostStatus hostReachable currentReachabilityStatus switch hostStatus case NotReachable NSLog @ A gateway to the host server is down. self.hostActive..
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 sample code #define kOFFSET_FOR_KEYBOARD 80.0 void keyboardWillShow Animate the current view out of the way if self.view.frame.origin.y 0 self setViewMovedUp YES else if self.view.frame.origin.y 0 self setViewMovedUp NO void keyboardWillHide if self.view.frame.origin.y 0 self setViewMovedUp YES else if self.view.frame.origin.y.. 0 self setViewMovedUp YES else if self.view.frame.origin.y 0 self setViewMovedUp NO void keyboardWillHide if self.view.frame.origin.y 0 self setViewMovedUp YES else if self.view.frame.origin.y 0 self setViewMovedUp NO void textFieldDidBeginEditing UITextField sender if sender isEqual mailTf move the main view so that.. UITextField sender if sender isEqual mailTf move the main view so that the keyboard does not hide it. if self.view.frame.origin.y 0 self setViewMovedUp YES method to move the view up down whenever the keyboard is shown dismissed void setViewMovedUp BOOL movedUp UIView beginAnimations nil context NULL UIView setAnimationDuration..
How can I upload a photo to a server with the iPhone? http://stackoverflow.com/questions/125306/how-can-i-upload-a-photo-to-a-server-with-the-iphone filePath ASSERT data if data self uploadSucceeded NO return if data length 0 There's no data treat this the same as no file. self uploadSucceeded YES return NSData compressedData self compress data ASSERT compressedData compressedData length 0 if compressedData compressedData length 0 self uploadSucceeded NO.. @ s self 0x p n __func__ self Uploader Private connection didReceiveData Called when we have data from the server. We expect the server to reply with a YES if the upload succeeded or NO if it did not. Results None Side effects None void connection NSURLConnection connection IN didReceiveData NSData data IN NSLog.. NSString reply NSString alloc initWithData data encoding NSUTF8StringEncoding autorelease NSLog @ s data s n __func__ reply UTF8String if reply hasPrefix @ YES uploadDidSucceed YES @end Usage EPUploader alloc initWithURL NSURL URLWithString @ http yourserver.com uploadDB.php filePath @ path to some file delegate..
Add UIPickerView & a Button in Action sheet - How? http://stackoverflow.com/questions/1262574/add-uipickerview-a-button-in-action-sheet-how self.statesArray tableViewController.navigationItem.title @ States tableViewController.delegate self self presentViewController navigationController animated YES completion nil I create a simple example and posted it on github . Also see Showing actionsheet causes CGContext invalid context errors . share improve this answer..
How do I detect when someone shakes an iPhone? http://stackoverflow.com/questions/150446/how-do-i-detect-when-someone-shakes-an-iphone here to handle shake if super respondsToSelector @selector motionEnded withEvent super motionEnded motion withEvent event BOOL canBecomeFirstResponder return YES @end You can easily transform any UIView even system views into a view that can get the shake event simply by subclassing the view with only these methods and then..
How to call Objective-C from Javascript? http://stackoverflow.com/questions/1662473/how-to-call-objective-c-from-javascript This is the 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.. is the 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...
How to take a screenshot programmatically http://stackoverflow.com/questions/2200736/how-to-take-a-screenshot-programmatically image UIGraphicsGetImageFromCurrentImageContext UIGraphicsEndImageContext NSData data UIImagePNGRepresentation image data writeToFile @ foo.png atomically YES UPDATE April 2011 for retina display change the first line into this if UIScreen mainScreen respondsToSelector @selector scale UIGraphicsBeginImageContextWithOptions..
How can I send mail from an iPhone application http://stackoverflow.com/questions/310946/how-can-i-send-mail-from-an-iphone-application self controller setSubject @ My Subject controller setMessageBody @ Hello there. isHTML NO if controller self presentModalViewController controller animated YES controller release Then the user does the work and you get the delegate callback in time void mailComposeController MFMailComposeViewController controller didFinishWithResult.. MFMailComposeResult result error NSError error if result MFMailComposeResultSent NSLog @ It's away self dismissModalViewControllerAnimated YES Remember to check if the device is configured for sending email if MFMailComposeViewController canSendMail Show the composer else Handle the error share improve..
How do I export UIImage array as a movie? http://stackoverflow.com/questions/3741323/how-do-i-export-uiimage-array-as-a-movie a CGImage CVPixelBufferRef newPixelBufferFromCGImage CGImageRef image NSDictionary options NSDictionary dictionaryWithObjectsAndKeys NSNumber numberWithBool YES kCVPixelBufferCGImageCompatibilityKey NSNumber numberWithBool YES kCVPixelBufferCGBitmapContextCompatibilityKey nil CVPixelBufferRef pxbuffer NULL CVReturn status.. image NSDictionary options NSDictionary dictionaryWithObjectsAndKeys NSNumber numberWithBool YES kCVPixelBufferCGImageCompatibilityKey NSNumber numberWithBool YES kCVPixelBufferCGBitmapContextCompatibilityKey nil CVPixelBufferRef pxbuffer NULL CVReturn status CVPixelBufferCreate kCFAllocatorDefault frameSize.width frameSize.height..
Retrieving a pixel alpha value for a UIImage http://stackoverflow.com/questions/1042830/retrieving-a-pixel-alpha-value-for-a-uiimage alpha values were what I expected CGContextSetBlendMode context kCGBlendModeCopy iphone uikit core graphics quartz graphics share improve this question Yes CGContexts have their y axis pointing up while in UIKit it points down. See the docs . Edit after reading code You also want to set the blend mode to replace before..
'Missing recommended icon file - The bundle does not contain an app icon for iPhone / iPod Touch of exactly '120x120' pixels, in .png format' http://stackoverflow.com/questions/18736954/missing-recommended-icon-file-the-bundle-does-not-contain-an-app-icon-for-iph the very next day Kind of makes me wonder how many Apple Windows app review people lurk around here. iphone ios ios7 itunes share improve this question Yes you need to add a 120x120 high resolution icon. Now if you want to target only iOS 7 you just need 76 x 76 120 x 120 and 152 x 152 icon sizes. If you also want..
Objective-C categories in static library http://stackoverflow.com/questions/2567498/objective-c-categories-in-static-library option allows you to target a specific archive. we can use force_load to reduce app binary size and to avoid conflicts wich all_load can cause in some cases. Yes it works with .a files added to the project. Yet I had troubles with lib project added as direct dependency. But later I found that it was my fault direct dependency..
Is MonoTouch now banned on the iPhone? [closed] http://stackoverflow.com/questions/2604033/is-monotouch-now-banned-on-the-iphone improve this question Update This changed recently . MonoTouch should no longer conflict with the agreement. Any statements below are purely historical Yes it seems pretty clear from their license agreement now that if the original application is written in C# then it would be violating the license ...Applications..
What are the sizes used for the iOS application splash screen? http://stackoverflow.com/questions/2634898/what-are-the-sizes-used-for-the-ios-application-splash-screen this reply is rather old but stills seems popular. I've written a blog post based on Apple's doco and placed it on my blog . I hope you guys find it useful. Yes. In iPhone iPad development the Default.png file is displayed by the device automatically so you don't have to program it which is really useful. I don't have it..
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 way to change that variables and the .xib file based on the user's firmware Cheers. iphone iphone sdk 3.0 compatibility ios4 share improve this question Yes you can build with the latest SDK ie 5.1 and still run on devices with earlier versions of the firmware SDK . Set your Deployment Target to the earliest version..
Install xCode 3.2.3 w/ iPhone SDK 4, get “Base SDK missing”, can't see other SDKs http://stackoverflow.com/questions/3161385/install-xcode-3-2-3-w-iphone-sdk-4-get-base-sdk-missing-cant-see-other-sdk to do some conditional code to prevent crashes on 3.0 devices. Fun. You can still download from Apple and install a previous Xcode version or SDK cf. here . Yes you can install multiple Xcode versions in different directories i.e. put only one version in Developer. You can use the old Xcode to test your app's compliance..
iPhone App Minus App Store? http://stackoverflow.com/questions/37464/iphone-app-minus-app-store from the Keychain menu select Certificate Assistant then Create a Certificate. Name iPhone Developer Certificate Type Code Signing Let me override defaults Yes Click Continue Validity 3650 days Click Continue Blank out the Email address field. Click Continue until complete. You should see This root certificate is not trusted..
iphone/ipad: How exactly use NSAttributedString? http://stackoverflow.com/questions/3786528/iphone-ipad-how-exactly-use-nsattributedstring ipad How exactly use NSAttributedString Yes many people are saying about Rich Text in iphone ipad and many knows about NSAttributedString . But how to use NSAttributedString please I searched for much time..
Fast and Lean PDF Viewer for iPhone / iPad / iOs - tips and hints? http://stackoverflow.com/questions/3889634/fast-and-lean-pdf-viewer-for-iphone-ipad-ios-tips-and-hints and Lean PDF Viewer for iPhone iPad iOs tips and hints There has been many Questions recently about drawing PDF's. Yes you can render PDF's very easily with a UIWebView but this cant give the performance and functionality that you would expect from a good PDF viewer. You can draw..
How to build a framework or library for other developers, the secure way? http://stackoverflow.com/questions/4065052/how-to-build-a-framework-or-library-for-other-developers-the-secure-way beeing able to copy paste our source codes then is there a way to obfuscate the objective c code iphone ipad frameworks ios share improve this question Yes it is possible to build frameworks so the user of the framework can't see the source code. Check out these articles I've successfully used the first one to create..
How to filter NSFetchedResultsController (CoreData) with UISearchDisplayController/UISearchBar http://stackoverflow.com/questions/4471289/how-to-filter-nsfetchedresultscontroller-coredata-with-uisearchdisplaycontroll projects your question and the other wrong answer hinted at what to do . I tried Sergio's answer but had exception issues when actually running on a device. Yes you create two fetch results controllers one for the normal display and another one for the UISearchBar's table view. If you only use one FRC NSFetchedResultsController..
iOS download and save image inside app [duplicate] http://stackoverflow.com/questions/6238139/ios-download-and-save-image-inside-app it permantently inside my app I really have no idea but it would make a nice feature for my app. iphone cocoa touch ios ipad share improve this question Yes that's possible. Download Create and Display an Image from URL Check the below blog post it's step by step guide with source code . Download an Image and Save it..
program access to iPhone volume buttons http://stackoverflow.com/questions/772832/program-access-to-iphone-volume-buttons take care of adjusting the app's volume according to the rocker buttons. There's no other published way currently to handle this. PLEASE READ THE ABOVE NOTE Yes Use the MPVolumeView MPVolumeView volume MPVolumeView alloc initWithFrame CGRectMake 18.0 340.0 284.0 23.0 autorelease self view addSubview volume NSNotificationCenter..
Programmatically retrieve memory usage on iPhone http://stackoverflow.com/questions/787160/programmatically-retrieve-memory-usage-on-iphone retrieve memory usage on iPhone I'm trying to retrieve the amount of memory my iPhone app is using at anytime programmatically. Yes I'm aware about ObjectAlloc Leaks. I'm not interested in those only to know if it's possible to write some code and get the amount of bytes being used and report..
How to get information about free memory and running processes in an App Store approved app? (Yes, there is one!) http://stackoverflow.com/questions/8275578/how-to-get-information-about-free-memory-and-running-processes-in-an-app-store-a to get information about free memory and running processes in an App Store approved app Yes there is one There is an app called Activity Monitor Touch in the App Store which displays background processes as well as free memory. So there MUST be an public..
Is there a barcode recognition framework for iOS? http://stackoverflow.com/questions/838724/is-there-a-barcode-recognition-framework-for-ios iOS Is there a framework or other sample code for doing barcode recognition on iPhone iPad iphone ios cocoa touch barcode share improve this question Yes we produced the 'Barcodes' application for the iPhone. It can decode QR Codes. The source code is available from the zxing project specifically you want to take..
Is there any ready-made calendar control for iPhone apps? http://stackoverflow.com/questions/997779/is-there-any-ready-made-calendar-control-for-iphone-apps pick up something ready since this is a departure on the original project plans . iphone cocoa touch interface uikit calendar share improve this question Yes. These are the option I am aware of EDIT as of May 6 2010 1 GCCalendar 2 http github.com klazuka Kal 3 http code.google.com p iphonecal needs to be customized easily..
Declaration/definition of variables locations in ObjectiveC? http://stackoverflow.com/questions/12632285/declaration-definition-of-variables-locations-in-objectivec
Rounded UIView using CALayers - only some corners - How? http://stackoverflow.com/questions/2264083/rounded-uiview-using-calayers-only-some-corners-how to each of corners of supplied View. Instead I just wanted to apply roundness to selected corners like top top left bottom right etc. Is it possible IF yes then How Thanks in advance for sharing your knowledge. Sagar. iphone objective c xcode uiview calayer share improve this question I used the answer over at..
Easiest way to support multiple orientations? How do I load a custom NIB when the application is in Landscape? http://stackoverflow.com/questions/2496554/easiest-way-to-support-multiple-orientations-how-do-i-load-a-custom-nib-when-th You have to load one view then check orientation and load another if needed. You check orientation in shouldAutorotateToInterfaceOrientation returning yes if you want to rotate. I use a navigation controller to manage the transition. If I have the portrait view up and the device rotates I push the landscape view and..
Objective-C categories in static library http://stackoverflow.com/questions/2567498/objective-c-categories-in-static-library lib without setting all_load or ObjC flag. He just add to category h m files empty dummy class interface implementation to force linker use this file. And yes this trick do the job. But author also said he even not instantiated dummy object. Mm As I've found we should explicitly call some real code from category file...
Is it possible to program iPhone in C++ http://stackoverflow.com/questions/270455/is-it-possible-to-program-iphone-in-c So I'm curious is it possible to code iPhone apps with C while using the Cocoa API etc c iphone objective c share improve this question Short answer yes sort of. You can use Objective C which you can read about at Apple Developer Connection. If you know C already learning Objective C would be pretty simple if you..
Starting iPhone app development in Linux? http://stackoverflow.com/questions/276907/starting-iphone-app-development-in-linux in Linux I've heard that you need to get a Mac if you want to develop iPhone apps. Is this true Is it possible to develop iPhone apps using Linux If yes what do I need and where do I download the necessary tools iphone ios linux share improve this question To provide a differing response I'm running OS X and..
iPhone Facebook Video Upload http://stackoverflow.com/questions/5355846/iphone-facebook-video-upload never seem to merge anything not even trivial typo fixes in the documentation. Most of the time the pull requests simply sit there until rejected. And yes did I mention that the video upload code is a messy hack The video upload code is a messy hack. It parses some auth tokens and it could break anytime soon but it..
iPhone Data Usage Tracking/Monitoring http://stackoverflow.com/questions/7946699/iphone-data-usage-tracking-monitoring ifi_ibytes are stored from previous device reboot. i don't know why but ifi_opackets and ifi_ipackets are shown just for lo0 i think its main interface . yes. Then device is connected via WiFi and doesn't use internet if_iobytes values still come because this method provides network bytes exchanges and not just internet..
How to check for an active Internet Connection on iPhone SDK? http://stackoverflow.com/questions/1083701/how-to-check-for-an-active-internet-connection-on-iphone-sdk NSString URLString NSString stringWithContentsOfURL NSURL URLWithString @ http www.google.com return URLString NULL YES NO Is what I have done bad Not to mention stringWithContentsOfURL is deprecated in 3.0 And if so what is a better way to.. self.internetActive NO break case ReachableViaWiFi NSLog @ The internet is working via WIFI. self.internetActive YES break case ReachableViaWWAN NSLog @ The internet is working via WWAN. self.internetActive YES break NetworkStatus hostStatus.. self.internetActive YES break case ReachableViaWWAN NSLog @ The internet is working via WWAN. self.internetActive YES break NetworkStatus hostStatus hostReachable currentReachabilityStatus switch hostStatus case NotReachable NSLog @ A..
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 80.0 void keyboardWillShow Animate the current view out of the way if self.view.frame.origin.y 0 self setViewMovedUp YES else if self.view.frame.origin.y 0 self setViewMovedUp NO void keyboardWillHide if self.view.frame.origin.y 0 self setViewMovedUp.. 0 self setViewMovedUp NO void keyboardWillHide if self.view.frame.origin.y 0 self setViewMovedUp YES else if self.view.frame.origin.y 0 self setViewMovedUp NO void textFieldDidBeginEditing UITextField sender if sender isEqual.. mailTf move the main view so that the keyboard does not hide it. if self.view.frame.origin.y 0 self setViewMovedUp YES method to move the view up down whenever the keyboard is shown dismissed void setViewMovedUp BOOL movedUp UIView beginAnimations..
How can I upload a photo to a server with the iPhone? http://stackoverflow.com/questions/125306/how-can-i-upload-a-photo-to-a-server-with-the-iphone self uploadSucceeded NO return if data length 0 There's no data treat this the same as no file. self uploadSucceeded YES return NSData compressedData self compress data ASSERT compressedData compressedData length 0 if compressedData compressedData.. Private connection didReceiveData Called when we have data from the server. We expect the server to reply with a YES if the upload succeeded or NO if it did not. Results None Side effects None void connection NSURLConnection connection.. data encoding NSUTF8StringEncoding autorelease NSLog @ s data s n __func__ reply UTF8String if reply hasPrefix @ YES uploadDidSucceed YES @end Usage EPUploader alloc initWithURL NSURL URLWithString @ http yourserver.com uploadDB.php filePath..
Add UIPickerView & a Button in Action sheet - How? http://stackoverflow.com/questions/1262574/add-uipickerview-a-button-in-action-sheet-how @ States tableViewController.delegate self self presentViewController navigationController animated YES completion nil I create a simple example and posted it on github . Also see Showing actionsheet causes CGContext invalid..
How do I detect when someone shakes an iPhone? http://stackoverflow.com/questions/150446/how-do-i-detect-when-someone-shakes-an-iphone @selector motionEnded withEvent super motionEnded motion withEvent event BOOL canBecomeFirstResponder return YES @end You can easily transform any UIView even system views into a view that can get the shake event simply by subclassing..
How to call Objective-C from Javascript? http://stackoverflow.com/questions/1662473/how-to-call-objective-c-from-javascript 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.. 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..
How to take a screenshot programmatically http://stackoverflow.com/questions/2200736/how-to-take-a-screenshot-programmatically UIGraphicsEndImageContext NSData data UIImagePNGRepresentation image data writeToFile @ foo.png atomically YES UPDATE April 2011 for retina display change the first line into this if UIScreen mainScreen respondsToSelector @selector..
How can I send mail from an iPhone application http://stackoverflow.com/questions/310946/how-can-i-send-mail-from-an-iphone-application controller setMessageBody @ Hello there. isHTML NO if controller self presentModalViewController controller animated YES controller release Then the user does the work and you get the delegate callback in time void mailComposeController MFMailComposeViewController.. error NSError error if result MFMailComposeResultSent NSLog @ It's away self dismissModalViewControllerAnimated YES Remember to check if the device is configured for sending email if MFMailComposeViewController canSendMail Show the composer..
How do I export UIImage array as a movie? http://stackoverflow.com/questions/3741323/how-do-i-export-uiimage-array-as-a-movie CGImageRef image NSDictionary options NSDictionary dictionaryWithObjectsAndKeys NSNumber numberWithBool YES kCVPixelBufferCGImageCompatibilityKey NSNumber numberWithBool YES kCVPixelBufferCGBitmapContextCompatibilityKey nil CVPixelBufferRef.. dictionaryWithObjectsAndKeys NSNumber numberWithBool YES kCVPixelBufferCGImageCompatibilityKey NSNumber numberWithBool YES kCVPixelBufferCGBitmapContextCompatibilityKey nil CVPixelBufferRef pxbuffer NULL CVReturn status CVPixelBufferCreate kCFAllocatorDefault..
Retrieving a pixel alpha value for a UIImage http://stackoverflow.com/questions/1042830/retrieving-a-pixel-alpha-value-for-a-uiimage context kCGBlendModeCopy iphone uikit core graphics quartz graphics share improve this question Yes CGContexts have their y axis pointing up while in UIKit it points down. See the docs . Edit after reading code You also..
'Missing recommended icon file - The bundle does not contain an app icon for iPhone / iPod Touch of exactly '120x120' pixels, in .png format' http://stackoverflow.com/questions/18736954/missing-recommended-icon-file-the-bundle-does-not-contain-an-app-icon-for-iph how many Apple Windows app review people lurk around here. iphone ios ios7 itunes share improve this question Yes you need to add a 120x120 high resolution icon. Now if you want to target only iOS 7 you just need 76 x 76 120 x 120 and..
Animating a custom property of CALayer subclass http://stackoverflow.com/questions/2395382/animating-a-custom-property-of-calayer-subclass override to make my custom myInt property animatable iphone core animation calayer share improve this question Yes it's possible only in the latest Core Animation releases though I believe i.e. iPhone 3.0 and OS X 10.6 . Make your property..
Objective-C categories in static library http://stackoverflow.com/questions/2567498/objective-c-categories-in-static-library archive. we can use force_load to reduce app binary size and to avoid conflicts wich all_load can cause in some cases. Yes it works with .a files added to the project. Yet I had troubles with lib project added as direct dependency. But later I..
Is MonoTouch now banned on the iPhone? [closed] http://stackoverflow.com/questions/2604033/is-monotouch-now-banned-on-the-iphone changed recently . MonoTouch should no longer conflict with the agreement. Any statements below are purely historical Yes it seems pretty clear from their license agreement now that if the original application is written in C# then it would be..
What are the sizes used for the iOS application splash screen? http://stackoverflow.com/questions/2634898/what-are-the-sizes-used-for-the-ios-application-splash-screen popular. I've written a blog post based on Apple's doco and placed it on my blog . I hope you guys find it useful. Yes. In iPhone iPad development the Default.png file is displayed by the device automatically so you don't have to program it..
iPhone : can we open pdf file using UIWebView? http://stackoverflow.com/questions/2832245/iphone-can-we-open-pdf-file-using-uiwebview any code snippet or any weblink help... thanks in advance... iphone ios uiwebview share improve this question Yes this can be done with the UIWebView. If you are trying to display a PDF file residing on a server somewhere you can simple..
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 file based on the user's firmware Cheers. iphone iphone sdk 3.0 compatibility ios4 share improve this question Yes you can build with the latest SDK ie 5.1 and still run on devices with earlier versions of the firmware SDK . Set your Deployment..
Install xCode 3.2.3 w/ iPhone SDK 4, get “Base SDK missing”, can't see other SDKs http://stackoverflow.com/questions/3161385/install-xcode-3-2-3-w-iphone-sdk-4-get-base-sdk-missing-cant-see-other-sdk crashes on 3.0 devices. Fun. You can still download from Apple and install a previous Xcode version or SDK cf. here . Yes you can install multiple Xcode versions in different directories i.e. put only one version in Developer. You can use the..
iPhone App Minus App Store? http://stackoverflow.com/questions/37464/iphone-app-minus-app-store Assistant then Create a Certificate. Name iPhone Developer Certificate Type Code Signing Let me override defaults Yes Click Continue Validity 3650 days Click Continue Blank out the Email address field. Click Continue until complete. You should..
iphone/ipad: How exactly use NSAttributedString? http://stackoverflow.com/questions/3786528/iphone-ipad-how-exactly-use-nsattributedstring ipad How exactly use NSAttributedString Yes many people are saying about Rich Text in iphone ipad and many knows about NSAttributedString . But how to use NSAttributedString..
Fast and Lean PDF Viewer for iPhone / iPad / iOs - tips and hints? http://stackoverflow.com/questions/3889634/fast-and-lean-pdf-viewer-for-iphone-ipad-ios-tips-and-hints and Lean PDF Viewer for iPhone iPad iOs tips and hints There has been many Questions recently about drawing PDF's. Yes you can render PDF's very easily with a UIWebView but this cant give the performance and functionality that you would expect..
How to build a framework or library for other developers, the secure way? http://stackoverflow.com/questions/4065052/how-to-build-a-framework-or-library-for-other-developers-the-secure-way then is there a way to obfuscate the objective c code iphone ipad frameworks ios share improve this question Yes it is possible to build frameworks so the user of the framework can't see the source code. Check out these articles I've..
How to filter NSFetchedResultsController (CoreData) with UISearchDisplayController/UISearchBar http://stackoverflow.com/questions/4471289/how-to-filter-nsfetchedresultscontroller-coredata-with-uisearchdisplaycontroll answer hinted at what to do . I tried Sergio's answer but had exception issues when actually running on a device. Yes you create two fetch results controllers one for the normal display and another one for the UISearchBar's table view. If..
iOS download and save image inside app [duplicate] http://stackoverflow.com/questions/6238139/ios-download-and-save-image-inside-app have no idea but it would make a nice feature for my app. iphone cocoa touch ios ipad share improve this question Yes that's possible. Download Create and Display an Image from URL Check the below blog post it's step by step guide with source..
program access to iPhone volume buttons http://stackoverflow.com/questions/772832/program-access-to-iphone-volume-buttons according to the rocker buttons. There's no other published way currently to handle this. PLEASE READ THE ABOVE NOTE Yes Use the MPVolumeView MPVolumeView volume MPVolumeView alloc initWithFrame CGRectMake 18.0 340.0 284.0 23.0 autorelease self..
Programmatically retrieve memory usage on iPhone http://stackoverflow.com/questions/787160/programmatically-retrieve-memory-usage-on-iphone usage on iPhone I'm trying to retrieve the amount of memory my iPhone app is using at anytime programmatically. Yes I'm aware about ObjectAlloc Leaks. I'm not interested in those only to know if it's possible to write some code and get..
How to get information about free memory and running processes in an App Store approved app? (Yes, there is one!) http://stackoverflow.com/questions/8275578/how-to-get-information-about-free-memory-and-running-processes-in-an-app-store-a to get information about free memory and running processes in an App Store approved app Yes there is one There is an app called Activity Monitor Touch in the App Store which displays background processes as well..
Is there a barcode recognition framework for iOS? http://stackoverflow.com/questions/838724/is-there-a-barcode-recognition-framework-for-ios code for doing barcode recognition on iPhone iPad iphone ios cocoa touch barcode share improve this question Yes we produced the 'Barcodes' application for the iPhone. It can decode QR Codes. The source code is available from the zxing..
Is there any ready-made calendar control for iPhone apps? http://stackoverflow.com/questions/997779/is-there-any-ready-made-calendar-control-for-iphone-apps departure on the original project plans . iphone cocoa touch interface uikit calendar share improve this question Yes. These are the option I am aware of EDIT as of May 6 2010 1 GCCalendar 2 http github.com klazuka Kal 3 http code.google.com..
Accessing Web Service from iPhone http://stackoverflow.com/questions/1018369/accessing-web-service-from-iphone stig json framework However you should find it very easy to make web requests with the normal iPhone commands. Ah yes a tutorial SeismicXML or go and check out the Stanford lectures for CS193P lecture 9 should be your cup of tea http www.stanford.edu..
Uploading Video with iPhone http://stackoverflow.com/questions/1065628/uploading-video-with-iphone point me in the right direction that would be awesome. Thanks iphone video upload share improve this question yes this is possible and this is how i went about it. Impliment the following function which runs when the media picker is finished...
Full webpage and disabled zoom viewport meta tag for all mobile browsers http://stackoverflow.com/questions/11345896/full-webpage-and-disabled-zoom-viewport-meta-tag-for-all-mobile-browsers why your width option is having no effect. To allow the browser to scale your content you need to set user scalable yes then to disable zoom you can set the min and max scale to the same value so it cannot shrink or grow. Toy with the initial.. minimum scale 1.0 maximum scale 1.0 width device width height device height target densitydpi device dpi user scalable yes Android 4.x Same rule apply as 2.3.x except the min and max scales are not honored anymore and if you use user scalable.. 4.x Same rule apply as 2.3.x except the min and max scales are not honored anymore and if you use user scalable yes the user can always zoom setting it to 'no' means your own scale is ignored this is the issue I'm facing now that drew me..
Declaration/definition of variables locations in ObjectiveC? http://stackoverflow.com/questions/12632285/declaration-definition-of-variables-locations-in-objectivec
Rounded UIView using CALayers - only some corners - How? http://stackoverflow.com/questions/2264083/rounded-uiview-using-calayers-only-some-corners-how Instead I just wanted to apply roundness to selected corners like top top left bottom right etc. Is it possible IF yes then How Thanks in advance for sharing your knowledge. Sagar. iphone objective c xcode uiview calayer share improve this..
Easiest way to support multiple orientations? How do I load a custom NIB when the application is in Landscape? http://stackoverflow.com/questions/2496554/easiest-way-to-support-multiple-orientations-how-do-i-load-a-custom-nib-when-th orientation and load another if needed. You check orientation in shouldAutorotateToInterfaceOrientation returning yes if you want to rotate. I use a navigation controller to manage the transition. If I have the portrait view up and the device..
Objective-C categories in static library http://stackoverflow.com/questions/2567498/objective-c-categories-in-static-library flag. He just add to category h m files empty dummy class interface implementation to force linker use this file. And yes this trick do the job. But author also said he even not instantiated dummy object. Mm As I've found we should explicitly..
Is it possible to program iPhone in C++ http://stackoverflow.com/questions/270455/is-it-possible-to-program-iphone-in-c iPhone apps with C while using the Cocoa API etc c iphone objective c share improve this question Short answer yes sort of. You can use Objective C which you can read about at Apple Developer Connection. If you know C already learning..
Starting iPhone app development in Linux? http://stackoverflow.com/questions/276907/starting-iphone-app-development-in-linux to get a Mac if you want to develop iPhone apps. Is this true Is it possible to develop iPhone apps using Linux If yes what do I need and where do I download the necessary tools iphone ios linux share improve this question To provide..
Remove gradient background from UIWebView? http://stackoverflow.com/questions/3009063/remove-gradient-background-from-uiwebview http stackoverflow.com questions 655225 uiwebview underside ios iphone uiwebview share improve this question Aha yes terminology fail. I wouldn't call that a shadow at all but c'est la vie. Here is my type safe code to achieve the effect...
ApplicationWillTerminate in iOS 4.0 http://stackoverflow.com/questions/3139588/applicationwillterminate-in-ios-4-0 of the application delegate. Your application cannot request additional background execution time from this method. So yes applicationWillTerminate will generally not be called very often in iOS 4. If you have to save data you should do so in..
iOS: Using device modifiers for loading xib files? http://stackoverflow.com/questions/5191472/ios-using-device-modifiers-for-loading-xib-files
Creating a JSON Store For iPhone http://stackoverflow.com/questions/5237943/creating-a-json-store-for-iphone or just managed objects Remember entities are to managed objects what classes are to instances. If the former then yes Core Data will be a lot of work up front if the later then it won't be. You can build up very large complex graphs with..
iPhone Facebook Video Upload http://stackoverflow.com/questions/5355846/iphone-facebook-video-upload even trivial typo fixes in the documentation. Most of the time the pull requests simply sit there until rejected. And yes did I mention that the video upload code is a messy hack The video upload code is a messy hack. It parses some auth tokens..
Where would you place your SQLite database file in an iPhone app? http://stackoverflow.com/questions/717108/where-would-you-place-your-sqlite-database-file-in-an-iphone-app created ie a copy of the SQLite file has been created in the users document folder on the iPhone's file system. If yes you don't do anything else you would overwrite it with the default Xcode SQLite copy If no then you copy the SQLite file..
iPhone Data Usage Tracking/Monitoring http://stackoverflow.com/questions/7946699/iphone-data-usage-tracking-monitoring device reboot. i don't know why but ifi_opackets and ifi_ipackets are shown just for lo0 i think its main interface . yes. Then device is connected via WiFi and doesn't use internet if_iobytes values still come because this method provides network..
How to capture current view screenshot and reuse in code? (iPhone SDK) http://stackoverflow.com/questions/879064/how-to-capture-current-view-screenshot-and-reuse-in-code-iphone-sdk
|