iphone Programming Glossary: update
Retrieving a pixel alpha value for a UIImage http://stackoverflow.com/questions/1042830/retrieving-a-pixel-alpha-value-for-a-uiimage and Core Graphics i.e is the y axis inverted Or have I misunderstood premultiplied alpha values Update @Nikolai Ruhe's suggestion was key to this. I did not in fact need to translate between UIKit coordinates..
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 and Reachability.m to the project found here https github.com tonymillion Reachability 3 Update the interface section #import Reachability.h Add this to the interface in the .m file of your view controller.. @ www.google.com Internet is reachable internetReachableFoo.reachableBlock ^ Reachability reach Update the UI on the main thread dispatch_async dispatch_get_main_queue ^ NSLog @ Yayyy we have the interwebs.. interwebs Internet is not reachable internetReachableFoo.unreachableBlock ^ Reachability reach Update the UI on the main thread dispatch_async dispatch_get_main_queue ^ NSLog @ Someone broke the internet..
How to programmatically send SMS on the iPhone? http://stackoverflow.com/questions/10848/how-to-programmatically-send-sms-on-the-iphone ie your program on the iPhone sends a UDP packet to your server which sends the real SMS iOS 4 Update iOS 4 however now provides a viewcontroller you can import into your application. You prepopulate the.. class is well documented and tutorials show how easy it is to implement. iOS 5 Update iOS 5 includes messaging for iPod touch and iPad devices so while I've not yet tested this myself it..
Add UIPickerView & a Button in Action sheet - How? http://stackoverflow.com/questions/1262574/add-uipickerview-a-button-in-action-sheet-how please explain how this can be implemented iphone uipickerview share improve this question Update for iOS 7 Apple docs for UIActionSheet UIActionSheet is not designed to be subclassed nor should you..
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 UIInterfaceOrientationPortrait Are there any documented ways to force the orientation Update I thought I would provide an example as I am not looking for shouldAutorotateToInterfaceOrientation..
Creating a left-arrow button (like UINavigationBar's “back” style) on a UIToolbar http://stackoverflow.com/questions/227078/creating-a-left-arrow-button-like-uinavigationbars-back-style-on-a-uitoolba versatile results. Any ideas beyond screenshotting for every size and color scheme I intend to use Update PLEASE STOP dodging the question and suggesting that I shouldn't be asking this and should be using..
Bold & Non-Bold Text In A Single UILabel? http://stackoverflow.com/questions/3586871/bold-non-bold-text-in-a-single-uilabel Screenshot Thanks Dom iphone objective c ipad nsattributedstring share improve this question Update for iOS6 In iOS6 now UILabel UIButton UITextView UITextField and maybe others now support attributed.. and other constants that will make our life easier. Yay So if we have this string NSString text @ Updated 2012 10 14 21 59 We only need to create the attributed string if _label respondsToSelector @selector.. yyyy hh mm NSString dateString df stringFromDate refreshDate NSString prefix NSLocalizedString @ Updated nil NSString text NSString stringWithFormat @ @ @ prefix dateString df release Create the text layer..
How to customize the background/border colors of a grouped table view cell? http://stackoverflow.com/questions/400965/how-to-customize-the-background-border-colors-of-a-grouped-table-view-cell It's a real PITA but I've confirmed with Apple engineers that this is currently the only way. Update Here's the code for that custom bg view. There's a drawing bug that makes the rounded corners look a..
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 can also be a great way to distribute code that is used for multiple projects within your company. Update Check out the link featherless added below it is much more recent and all on one page http github.com..
“Warning: iPhone apps should include an armv6 architecture” even with build config set http://stackoverflow.com/questions/4198676/warning-iphone-apps-should-include-an-armv6-architecture-even-with-build-conf a new row with the plus button in the bottom left of the popover and type 'armv7' then click Done Update you should add armv7s to target the iPhone 5 as well. And drop armv6 if building with Xcode 4.5 or higher..
iPhone - Backgrounding to poll for events http://stackoverflow.com/questions/4656214/iphone-backgrounding-to-poll-for-events if this is the approach of the apps you mentioned before but it works for me. Hope I could help Update After measuring the time of the BG task there was a surprise. The BG Task is limited to 600 seconds... from the long running task. Just try it out. Use your Console to see what happens... Have Fun Update 2 Sometimes simplifying things helps. My new approach is this one void applicationDidEnterBackground.. the GPS radio on is sucking my battery down very quickly. Using the approach which I posted in Update 2 is taking nearly no energy. According to the userexperience this is a better approach. Maybe other..
CSS “position: fixed;” into iPad/iPhone? http://stackoverflow.com/questions/4889601/css-position-fixed-into-ipad-iphone mobile browser world is moving very quickly so tables like this may not stay up to date for long Update iOS 5 and Android 4 are both reported to have position fixed support now. I tested iOS 5 myself in an..
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 to the best legitimate suggestion critique I see by mid day Tuesday. See below deadline extended. Update Re OMZ's proposal here is what I'm finding Here is the category version h file #import Foundation Foundation.h..
Has anyone implemented the PayPal API through a native iPhone app? http://stackoverflow.com/questions/779423/has-anyone-implemented-the-paypal-api-through-a-native-iphone-app to a web interface. iphone objective c cocoa touch paypal share improve this question Re Update As answered below this code may still be useful for the purchase of physical goods Update Although this.. Re Update As answered below this code may still be useful for the purchase of physical goods Update Although this code works App Store terms won't allow you to use this code within an app. Original Answer..
How would I tint an image programatically on the iPhone? http://stackoverflow.com/questions/1117211/how-would-i-tint-an-image-programatically-on-the-iphone IB and calling setNeedsDisplay in my view controller. Update drawRect is not being called. Final update I found an old project that had an imageView set up properly so I could test Ramin's code and it works.. an imageView set up properly so I could test Ramin's code and it works like a charm Final final update For those of you just learning about Core Graphics here is the simplest thing that could possibly work...
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 older SDK limitations. I personally have been told by Apple to remove the method call on my next update so I am not yet sure if having a hack for older devices will get through the approval process. share..
Expand/collapse section in UITableView http://stackoverflow.com/questions/1938921/expand-collapse-section-in-uitableview numberOfPeopleInGroup section 1 else we just want the header cell return 1 You would also have to update your cellForRowAtIndexPath to return a custom header cell for the first row in any section. share improve..
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 firmware versions With iOS4 coming out soon I have already planned to include an iAd in a future update of an app of mine. I assume that this will make my app unusable for anyone on a firmware lower than..
iPhone App Minus App Store? http://stackoverflow.com/questions/37464/iphone-app-minus-app-store later you cannot do so via the standard SpringBoard interface and you'll need to use SSH and update the SpringBoard ssh root@jasoniphone.local rm r Applications AccelerometerGraph.app ssh mobile@jasoniphone.local..
NSDictionary with ordered keys http://stackoverflow.com/questions/376090/nsdictionary-with-ordered-keys store a separate array of the keys but that seems kind of kludgey because I'd always have to update the keys of the dictionary as well as the values of the array and make sure they always correspond...
display image from URL retrieved from ALAsset in iPhone http://stackoverflow.com/questions/3837115/display-image-from-url-retrieved-from-alasset-in-iphone if thumb blah blah Thats what I learned while trying to get this working anyway. iOS 5 update When the result block fires seems to be a bit slower with iOS5 maybe single core devices so I couldnt..
How to filter NSFetchedResultsController (CoreData) with UISearchDisplayController/UISearchBar http://stackoverflow.com/questions/4471289/how-to-filter-nsfetchedresultscontroller-coredata-with-uisearchdisplaycontroll FRC to pull the information from. The FRC delegate methods must also figure out which tableView to update. It is surprising how much of this is boilerplate code. Relevant bits of the header file @interface.. mark Content Filtering void filterContentForSearchText NSString searchText scope NSInteger scope update the filter in this case just blow away the FRC and let lazy evaluation create another with the relevant.. table view to be reloaded. return YES make sure that you use the correct table view when getting updates from the FRC delegate methods void controllerWillChangeContent NSFetchedResultsController controller..
How to Sync iPhone Core Data with web server, and then push to other devices? http://stackoverflow.com/questions/5035132/how-to-sync-iphone-core-data-with-web-server-and-then-push-to-other-devices have to poll the server without using up too much battery. The local devices will also need to update anything held in memory if when changes are received from the server. Is there anything else I am missing..
How do I size a UITextView to its content? http://stackoverflow.com/questions/50467/how-do-i-size-a-uitextview-to-its-content if auto layout is ON. With auto layout the general approach is to use the sizeThatFits method and update the constant value on a height constraint. CGSize sizeThatShouldFitTheContent _textView sizeThatFits..
CADisplayLink OpenGL rendering breaks UIScrollView behaviour http://stackoverflow.com/questions/5944050/cadisplaylink-opengl-rendering-breaks-uiscrollview-behaviour is dragged on iPhone iphone opengl es share improve this question It's possible that slow updates on the main thread triggered by the CADisplayLink are what's breaking UIScrollView's scrolling behavior.. on a background thread by using a Grand Central Dispatch serial queue. I did this in my recent update to Molecules source code for which can be found at that link and in testing with using NSRunLoopCommonModes.. For this you can create a GCD serial dispatch queue and use it for all of your rendering updates to a particular OpenGL ES context to avoid two actions writing to the context at the same time. Then..
How do I get a background location update every n minutes in my iOS application? http://stackoverflow.com/questions/6347503/how-do-i-get-a-background-location-update-every-n-minutes-in-my-ios-application do I get a background location update every n minutes in my iOS application I'm looking for a way to get a background location update every.. update every n minutes in my iOS application I'm looking for a way to get a background location update every n minutes in my iOS application. I'm using iOS 4.3 and the solution should work for non jailbroken.. background as expected based on the configured properties but it seems not possible to force it to update the location every n minutes NSTimer Does work when the app is running in the foreground but doesn't..
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 placed in the code are hit so it's not simply a case of the code somehow not getting used. Bounty update Since I haven't gotten any applicable replies yet I'll extend the bounty deadline for another day or..
Lock Unlock events iphone http://stackoverflow.com/questions/706344/lock-unlock-events-iphone
iCloud basics and code sample [closed] http://stackoverflow.com/questions/7795629/icloud-basics-and-code-sample @ NSLog @ UIDocument Loaded the following text from the cloud @ self.documentText update textView in delegate... if _delegate respondsToSelector @selector noteDocumentContentsUpdated _delegate.. theTextView NSLog @ VC textViewDidChange _document.documentText theTextView.text _document updateChangeCount UIDocumentChangeDone iphone objective c ios cocoa touch icloud share improve this question..
How do you optionally use iPhone OS 3.0 features in a 2.0 compatible app? http://stackoverflow.com/questions/986589/how-do-you-optionally-use-iphone-os-3-0-features-in-a-2-0-compatible-app on a 3.0 device. I don't want to go 3.0 all the way because there are customers who do not want to update yet. I experimented a bit with weak linking of the MapKit.framework weak_framework MapKit . I found..
How to implement re-ordering of CoreData records? http://stackoverflow.com/questions/1077568/how-to-implement-re-ordering-of-coredata-records NSIndexPath fromIndexPath toIndexPath NSIndexPath toIndexPath userDrivenDataModelChange YES ... UPDATE THE MODEL then SAVE CONTEXT ... userDrivenDataModelChange NO and also prevent the notifications to do..
UIImagePickerController and extracting EXIF data from existing photos http://stackoverflow.com/questions/1238838/uiimagepickercontroller-and-extracting-exif-data-from-existing-photos we can convert the UIImage into a NSData instance and then use it with the iPhone exif library. UPDATE I gave a test to the library mentioned above and it seems to work. However because of my limited knwoledge.. define a global variable to get it running as explained in the doc but hum.. BOOL gLogging FALSE UPDATE 2 Answer here iPhone access location information from a photo A UIImage does not encapsulate the meta.. meta information so we're stuck for sure no EXIF info will be given through this interface. FINAL UPDATE Ok I managed to get it working at least to geotag properly pictures returned by the picker. Before triggering..
'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 you don ™t want the OS to interpolate them As per the blog post New Metrics for iOS 7 App Icons . UPDATE As per Apple Guideline App icon OR Icon and Image Sizes Icon dimensions iOS 7 and later Icon dimensions..
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..
A html5 web app for mobile safari to upload images from the Photos.app? http://stackoverflow.com/questions/3891831/a-html5-web-app-for-mobile-safari-to-upload-images-from-the-photos-app anything. 2 mobile safari can't access ios components actually it can but only through phonegap UPDATE iOs 6 Safari is going to support upload videos and images from the Photo Library. share improve this..
How to customize the background/border colors of a grouped table view cell? http://stackoverflow.com/questions/400965/how-to-customize-the-background-border-colors-of-a-grouped-table-view-cell style table view iphone cocoa touch uitableview uitableviewcell share improve this question UPDATE In iPhone OS 3.0 and later UITableViewCell now has a backgroundColor property that makes this really..
Can we retrieve the applications currently running in iPhone and iPad http://stackoverflow.com/questions/4312613/can-we-retrieve-the-applications-currently-running-in-iphone-and-ipad running in iPhone and iPad Can we retrieve the applications currently running in iPhone and iPad UPDATE Can we do it in jail broken phones Can we do it for an app for CYDIA Store iphone ios4 share improve..
How do I reset after a UIScrollView zoom? http://stackoverflow.com/questions/448285/how-do-i-reset-after-a-uiscrollview-zoom the correct scaling behavior while letting you draw a crisp view at the completion of a zoom. UPDATE 7 23 2010 iPhone OS 3.2 and above have changed the behavior of scroll views in regards to zooming. Now..
Store orientation to an array - and compare http://stackoverflow.com/questions/6368618/store-orientation-to-an-array-and-compare exactly the same values but they can be somewhat the same. Am I at all on the right track here UPDATE I think that maybe Alis answer about using DTW could be the right way for me here. But I'm not that..
Has anyone implemented the PayPal API through a native iPhone app? http://stackoverflow.com/questions/779423/has-anyone-implemented-the-paypal-api-through-a-native-iphone-app right and has anyone got or seen any sample code I have to think this is a common piece of code. UPDATE Will Apple allow this It is a charity app so I am assuming there is no issue. Re UPDATE I assumed wrong... of code. UPDATE Will Apple allow this It is a charity app so I am assuming there is no issue. Re UPDATE I assumed wrong. Apple will not allow payments directly within apps using paypal. You have to re direct..
Testing CoreLocation on iPhone Simulator http://stackoverflow.com/questions/802156/testing-corelocation-on-iphone-simulator CoreLocation on iPhone Simulator UPDATE As of iOS 5 and Xcode 4.1 is is now possible to test location in the simulator and even define routes...
Reducing piracy of iPhone applications http://stackoverflow.com/questions/846309/reducing-piracy-of-iphone-applications how piracy is inevitable etc. iphone piracy piracy prevention share improve this question UPDATE Please visit and read Thanks to chpwn in the comments. Code that's way too old 11th May 2009 For now..
View Controllers: How to switch between views programmatically? http://stackoverflow.com/questions/910994/view-controllers-how-to-switch-between-views-programmatically I believe that the Tab Bar Controller has all this cleverness under the hood. Or am I wrong UPDATE I've tested it. If I release the view controller for example ViewControllerA I will get no log message..
Retrieving a pixel alpha value for a UIImage http://stackoverflow.com/questions/1042830/retrieving-a-pixel-alpha-value-for-a-uiimage channel. Do I need to translate the co ordinates between UIKit and Core Graphics i.e is the y axis inverted Or have I misunderstood premultiplied alpha values Update @Nikolai Ruhe's suggestion was key to this. I did not in fact need to translate between UIKit coordinates and Core Graphics coordinates. However after setting the..
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 including it anywhere 2 Add Tony Million's version of Reachability.h and Reachability.m to the project found here https github.com tonymillion Reachability 3 Update the interface section #import Reachability.h Add this to the interface in the .m file of your view controller @interface MyViewController Reachability internetReachableFoo.. internetReachableFoo Reachability reachabilityWithHostname @ www.google.com Internet is reachable internetReachableFoo.reachableBlock ^ Reachability reach Update the UI on the main thread dispatch_async dispatch_get_main_queue ^ NSLog @ Yayyy we have the interwebs Internet is not reachable internetReachableFoo.unreachableBlock.. dispatch_get_main_queue ^ NSLog @ Yayyy we have the interwebs Internet is not reachable internetReachableFoo.unreachableBlock ^ Reachability reach Update the UI on the main thread dispatch_async dispatch_get_main_queue ^ NSLog @ Someone broke the internet internetReachableFoo startNotifier METHOD 2 Do it yourself..
How to programmatically send SMS on the iPhone? http://stackoverflow.com/questions/10848/how-to-programmatically-send-sms-on-the-iphone send the SMSs via that route if you need complete automation. ie your program on the iPhone sends a UDP packet to your server which sends the real SMS iOS 4 Update iOS 4 however now provides a viewcontroller you can import into your application. You prepopulate the SMS fields then the user can initiate the SMS send within.. and avoids closing the application. The MFMessageComposeViewController class is well documented and tutorials show how easy it is to implement. iOS 5 Update iOS 5 includes messaging for iPod touch and iPad devices so while I've not yet tested this myself it may be that all iOS devices will be able to send SMS via MFMessageComposeViewController...
Add UIPickerView & a Button in Action sheet - How? http://stackoverflow.com/questions/1262574/add-uipickerview-a-button-in-action-sheet-how included an image to understand my requirements. Could you please explain how this can be implemented iphone uipickerview share improve this question Update for iOS 7 Apple docs for UIActionSheet UIActionSheet is not designed to be subclassed nor should you add views to its hierarchy I recommend against trying to customize..
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 with a future revision of the SDK. UIDevice currentDevice setOrientation UIInterfaceOrientationPortrait Are there any documented ways to force the orientation Update I thought I would provide an example as I am not looking for shouldAutorotateToInterfaceOrientation as I have already implemented that. I want my app to support..
Creating a left-arrow button (like UINavigationBar's “back” style) on a UIToolbar http://stackoverflow.com/questions/227078/creating-a-left-arrow-button-like-uinavigationbars-back-style-on-a-uitoolba channel edges so screenshotting and cutting won't get very versatile results. Any ideas beyond screenshotting for every size and color scheme I intend to use Update PLEASE STOP dodging the question and suggesting that I shouldn't be asking this and should be using UINavigationBar. My app is Instapaper Pro. It shows only a bottom..
Bold & Non-Bold Text In A Single UILabel? http://stackoverflow.com/questions/3586871/bold-non-bold-text-in-a-single-uilabel ideas Apple achieves this in several of their apps Examples Screenshot Thanks Dom iphone objective c ipad nsattributedstring share improve this question Update for iOS6 In iOS6 now UILabel UIButton UITextView UITextField and maybe others now support attributed strings which means we don't need to create CATextLayer s as.. classes in obj c Foundation.framework like NSParagraphStyle and other constants that will make our life easier. Yay So if we have this string NSString text @ Updated 2012 10 14 21 59 We only need to create the attributed string if _label respondsToSelector @selector setAttributedText iOS6 and above Use NSAttributedStrings const.. df NSDateFormatter alloc init df setDateFormat @ MM dd yyyy hh mm NSString dateString df stringFromDate refreshDate NSString prefix NSLocalizedString @ Updated nil NSString text NSString stringWithFormat @ @ @ prefix dateString df release Create the text layer on demand if _textLayer _textLayer CATextLayer alloc init..
How to customize the background/border colors of a grouped table view cell? http://stackoverflow.com/questions/400965/how-to-customize-the-background-border-colors-of-a-grouped-table-view-cell it in the UITableViewDataSource's cellForRowAtIndexPath method. It's a real PITA but I've confirmed with Apple engineers that this is currently the only way. Update Here's the code for that custom bg view. There's a drawing bug that makes the rounded corners look a little funny but we moved to a different design and scrapped..
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 included only the compiled output is in the bundle . This can also be a great way to distribute code that is used for multiple projects within your company. Update Check out the link featherless added below it is much more recent and all on one page http github.com jverkoey iOS Framework . It also lays out the issues with..
“Warning: iPhone apps should include an armv6 architecture” even with build config set http://stackoverflow.com/questions/4198676/warning-iphone-apps-should-include-an-armv6-architecture-even-with-build-conf that appears and replace it by typing 'armv6'. Then add a new row with the plus button in the bottom left of the popover and type 'armv7' then click Done Update you should add armv7s to target the iPhone 5 as well. And drop armv6 if building with Xcode 4.5 or higher which no longer supports armv6. That's it. You should..
iPhone - Backgrounding to poll for events http://stackoverflow.com/questions/4656214/iphone-backgrounding-to-poll-for-events must jump back into your last state after wakeup. I don't know if this is the approach of the apps you mentioned before but it works for me. Hope I could help Update After measuring the time of the BG task there was a surprise. The BG Task is limited to 600 seconds. This is the exact minimum time of the VoIP minimumtime setKeepAliveTimeout.. Maybe one can do sth. like this inside the expirationHandler from the long running task. Just try it out. Use your Console to see what happens... Have Fun Update 2 Sometimes simplifying things helps. My new approach is this one void applicationDidEnterBackground UIApplication application UIApplication app UIApplication sharedApplication.. I measured something. Using the location callbacks with having the GPS radio on is sucking my battery down very quickly. Using the approach which I posted in Update 2 is taking nearly no energy. According to the userexperience this is a better approach. Maybe other Apps work like this hiding its behavior behind GPS functionality..
CSS “position: fixed;” into iPad/iPhone? http://stackoverflow.com/questions/4889601/css-position-fixed-into-ipad-iphone fixed http www.quirksmode.org m css.html but note that the mobile browser world is moving very quickly so tables like this may not stay up to date for long Update iOS 5 and Android 4 are both reported to have position fixed support now. I tested iOS 5 myself in an Apple store today and can confirm that it does work with position..
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 en_US_POSIX return me @end Bounty I'll award the bounty to the best legitimate suggestion critique I see by mid day Tuesday. See below deadline extended. Update Re OMZ's proposal here is what I'm finding Here is the category version h file #import Foundation Foundation.h @interface NSDateFormatter Locale id initWithSafeLocale..
Has anyone implemented the PayPal API through a native iPhone app? http://stackoverflow.com/questions/779423/has-anyone-implemented-the-paypal-api-through-a-native-iphone-app directly within apps using paypal. You have to re direct to a web interface. iphone objective c cocoa touch paypal share improve this question Re Update As answered below this code may still be useful for the purchase of physical goods Update Although this code works App Store terms won't allow you to use this code.. objective c cocoa touch paypal share improve this question Re Update As answered below this code may still be useful for the purchase of physical goods Update Although this code works App Store terms won't allow you to use this code within an app. Original Answer I figured this out after some heavy API research. Below..
How would I tint an image programatically on the iPhone? http://stackoverflow.com/questions/1117211/how-would-i-tint-an-image-programatically-on-the-iphone I also tried loading other images setting the image in IB and calling setNeedsDisplay in my view controller. Update drawRect is not being called. Final update I found an old project that had an imageView set up properly so I could test Ramin's code and it works like a charm Final final update For those of you just learning.. not being called. Final update I found an old project that had an imageView set up properly so I could test Ramin's code and it works like a charm Final final update For those of you just learning about Core Graphics here is the simplest thing that could possibly work. In your subclassed UIView void drawRect CGRect rect CGContextRef..
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
Expand/collapse section in UITableView http://stackoverflow.com/questions/1938921/expand-collapse-section-in-uitableview
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. I assume that this will make my app unusable for anyone on a firmware lower than 4.0. Is there a way to change that variables and the .xib file..
iPhone App Minus App Store? http://stackoverflow.com/questions/37464/iphone-app-minus-app-store
NSDictionary with ordered keys http://stackoverflow.com/questions/376090/nsdictionary-with-ordered-keys that I can write an algorithm to sort them into . I could always store a separate array of the keys but that seems kind of kludgey because I'd always have to update the keys of the dictionary as well as the values of the array and make sure they always correspond. Currently I just use myDictionary allKeys but obviously this..
display image from URL retrieved from ALAsset in iPhone http://stackoverflow.com/questions/3837115/display-image-from-url-retrieved-from-alasset-in-iphone your use. node.view findLargeImage UIImage thumb node.view.largeImage if thumb blah blah Thats what I learned while trying to get this working anyway. iOS 5 update When the result block fires seems to be a bit slower with iOS5 maybe single core devices so I couldnt rely on the image to be available directly after calling findLargeImage..
How to filter NSFetchedResultsController (CoreData) with UISearchDisplayController/UISearchBar http://stackoverflow.com/questions/4471289/how-to-filter-nsfetchedresultscontroller-coredata-with-uisearchdisplaycontroll out what table view it will query and which applicable FRC to pull the information from. The FRC delegate methods must also figure out which tableView to update. It is surprising how much of this is boilerplate code. Relevant bits of the header file @interface BlahViewController UITableViewController UISearchBarDelegate.. Delegate methods for the search bar #pragma mark #pragma mark Content Filtering void filterContentForSearchText NSString searchText scope NSInteger scope update the filter in this case just blow away the FRC and let lazy evaluation create another with the relevant search info self.searchFetchedResultsController.delegate.. Return YES to cause the search result table view to be reloaded. return YES make sure that you use the correct table view when getting updates from the FRC delegate methods void controllerWillChangeContent NSFetchedResultsController controller UITableView tableView controller self.fetchedResultsController..
How to Sync iPhone Core Data with web server, and then push to other devices? http://stackoverflow.com/questions/5035132/how-to-sync-iphone-core-data-with-web-server-and-then-push-to-other-devices be timestamped so that they can be merged. The device will have to poll the server without using up too much battery. The local devices will also need to update anything held in memory if when changes are received from the server. Is there anything else I am missing here What kinds of frameworks should I look at to make..
How do I size a UITextView to its content? http://stackoverflow.com/questions/50467/how-do-i-size-a-uitextview-to-its-content . Prior to that it is equal to frame.size This will not work if auto layout is ON. With auto layout the general approach is to use the sizeThatFits method and update the constant value on a height constraint. CGSize sizeThatShouldFitTheContent _textView sizeThatFits _textView.frame.size heightConstraint.constant sizeThatShouldFitTheContent.height..
CADisplayLink OpenGL rendering breaks UIScrollView behaviour http://stackoverflow.com/questions/5944050/cadisplaylink-opengl-rendering-breaks-uiscrollview-behaviour NSRunLoop Animation in OpenGL ES view freezes when UIScrollView is dragged on iPhone iphone opengl es share improve this question It's possible that slow updates on the main thread triggered by the CADisplayLink are what's breaking UIScrollView's scrolling behavior here. Your OpenGL ES rendering might be taking long enough.. way around this is to perform your OpenGL ES rendering actions on a background thread by using a Grand Central Dispatch serial queue. I did this in my recent update to Molecules source code for which can be found at that link and in testing with using NSRunLoopCommonModes on my CADisplayLink I don't see any interruption of.. of a table view that's onscreen at the same time as the rendering. For this you can create a GCD serial dispatch queue and use it for all of your rendering updates to a particular OpenGL ES context to avoid two actions writing to the context at the same time. Then within your CADisplayLink callback you can use code like the..
How do I get a background location update every n minutes in my iOS application? http://stackoverflow.com/questions/6347503/how-do-i-get-a-background-location-update-every-n-minutes-in-my-ios-application do I get a background location update every n minutes in my iOS application I'm looking for a way to get a background location update every n minutes in my iOS application. I'm using iOS 4.3 and the.. do I get a background location update every n minutes in my iOS application I'm looking for a way to get a background location update every n minutes in my iOS application. I'm using iOS 4.3 and the solution should work for non jailbroken iPhones. I tried considered following options CLLocationManager.. startMonitoringSignificantLocationChanges This works in the background as expected based on the configured properties but it seems not possible to force it to update the location every n minutes NSTimer Does work when the app is running in the foreground but doesn't seem to be designed for background tasks Local notifications..
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 log in the category version IS getting executed and stops placed in the code are hit so it's not simply a case of the code somehow not getting used. Bounty 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..
Lock Unlock events iphone http://stackoverflow.com/questions/706344/lock-unlock-events-iphone
iCloud basics and code sample [closed] http://stackoverflow.com/questions/7795629/icloud-basics-and-code-sample length contents length encoding NSUTF8StringEncoding else self.documentText @ NSLog @ UIDocument Loaded the following text from the cloud @ self.documentText update textView in delegate... if _delegate respondsToSelector @selector noteDocumentContentsUpdated _delegate noteDocumentContentsUpdated self return YES WRITING id.. noteDocument.documentText void textViewDidChange UITextView theTextView NSLog @ VC textViewDidChange _document.documentText theTextView.text _document updateChangeCount UIDocumentChangeDone iphone objective c ios cocoa touch icloud share improve this question I just re read the docs and it appears that my general..
How do you optionally use iPhone OS 3.0 features in a 2.0 compatible app? http://stackoverflow.com/questions/986589/how-do-you-optionally-use-iphone-os-3-0-features-in-a-2-0-compatible-app some features of iPhone OS 3.0 in my 2.0 app when it runs on a 3.0 device. I don't want to go 3.0 all the way because there are customers who do not want to update yet. I experimented a bit with weak linking of the MapKit.framework weak_framework MapKit . I found it quite cumbersome since I had to trick the compiler linker..
How to implement re-ordering of CoreData records? http://stackoverflow.com/questions/1077568/how-to-implement-re-ordering-of-coredata-records method void tableView UITableView tableView moveRowAtIndexPath NSIndexPath fromIndexPath toIndexPath NSIndexPath toIndexPath userDrivenDataModelChange YES ... UPDATE THE MODEL then SAVE CONTEXT ... userDrivenDataModelChange NO and also prevent the notifications to do anything as changes are already done by the user void controllerWillChangeContent..
UIImagePickerController and extracting EXIF data from existing photos http://stackoverflow.com/questions/1238838/uiimagepickercontroller-and-extracting-exif-data-from-existing-photos UIImage image CGFloat compressionQuality Then we can convert the UIImage into a NSData instance and then use it with the iPhone exif library. UPDATE I gave a test to the library mentioned above and it seems to work. However because of my limited knwoledge about the EXIF format and the lack of high level API.. nil In case you want to give a try to the library you need to define a global variable to get it running as explained in the doc but hum.. BOOL gLogging FALSE UPDATE 2 Answer here iPhone access location information from a photo A UIImage does not encapsulate the meta information so we're stuck for sure no EXIF info will be given.. information from a photo A UIImage does not encapsulate the meta information so we're stuck for sure no EXIF info will be given through this interface. FINAL UPDATE Ok I managed to get it working at least to geotag properly pictures returned by the picker. Before triggering the UIImagePickerController it's up to you to use..
'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 icon sizes. Without counting Spotlight and Settings icon if you don ™t want the OS to interpolate them As per the blog post New Metrics for iOS 7 App Icons . UPDATE As per Apple Guideline App icon OR Icon and Image Sizes Icon dimensions iOS 7 and later Icon dimensions iOS 6.1 and earlier Create different sizes of the app icon..
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 self.window.bounds.size..
A html5 web app for mobile safari to upload images from the Photos.app? http://stackoverflow.com/questions/3891831/a-html5-web-app-for-mobile-safari-to-upload-images-from-the-photos-app
How to customize the background/border colors of a grouped table view cell? http://stackoverflow.com/questions/400965/how-to-customize-the-background-border-colors-of-a-grouped-table-view-cell change. How do I customize these two aspects of the grouped style table view iphone cocoa touch uitableview uitableviewcell share improve this question UPDATE In iPhone OS 3.0 and later UITableViewCell now has a backgroundColor property that makes this really easy especially in combination with the UIColor colorWithPatternImage..
Can we retrieve the applications currently running in iPhone and iPad http://stackoverflow.com/questions/4312613/can-we-retrieve-the-applications-currently-running-in-iphone-and-ipad we retrieve the applications currently running in iPhone and iPad Can we retrieve the applications currently running in iPhone and iPad UPDATE Can we do it in jail broken phones Can we do it for an app for CYDIA Store iphone ios4 share improve this question You can get a list of running processes..
How do I reset after a UIScrollView zoom? http://stackoverflow.com/questions/448285/how-do-i-reset-after-a-uiscrollview-zoom in the normal setTransform method. This seems to provide the correct scaling behavior while letting you draw a crisp view at the completion of a zoom. UPDATE 7 23 2010 iPhone OS 3.2 and above have changed the behavior of scroll views in regards to zooming. Now a UIScrollView will respect the identity transform you apply..
Store orientation to an array - and compare http://stackoverflow.com/questions/6368618/store-orientation-to-an-array-and-compare I compare the two arrays in a smart way They will never have exactly the same values but they can be somewhat the same. Am I at all on the right track here UPDATE I think that maybe Alis answer about using DTW could be the right way for me here. But I'm not that smart apparently so if anyone could help me out with the first..
Has anyone implemented the PayPal API through a native iPhone app? http://stackoverflow.com/questions/779423/has-anyone-implemented-the-paypal-api-through-a-native-iphone-app the user would need to use their API key. Does this sound right and has anyone got or seen any sample code I have to think this is a common piece of code. UPDATE Will Apple allow this It is a charity app so I am assuming there is no issue. Re UPDATE I assumed wrong. Apple will not allow payments directly within apps using.. seen any sample code I have to think this is a common piece of code. UPDATE Will Apple allow this It is a charity app so I am assuming there is no issue. Re UPDATE I assumed wrong. Apple will not allow payments directly within apps using paypal. You have to re direct to a web interface. iphone objective c cocoa touch paypal..
Testing CoreLocation on iPhone Simulator http://stackoverflow.com/questions/802156/testing-corelocation-on-iphone-simulator CoreLocation on iPhone Simulator UPDATE As of iOS 5 and Xcode 4.1 is is now possible to test location in the simulator and even define routes. See http developer.apple.com for more details. Legacy Question..
Reducing piracy of iPhone applications http://stackoverflow.com/questions/846309/reducing-piracy-of-iphone-applications present time Please refrain from non programming answers about how piracy is inevitable etc. iphone piracy piracy prevention share improve this question UPDATE Please visit and read Thanks to chpwn in the comments. Code that's way too old 11th May 2009 For now there's an easier way to detect if your iPhone application..
View Controllers: How to switch between views programmatically? http://stackoverflow.com/questions/910994/view-controllers-how-to-switch-between-views-programmatically does it know that viewWillAppear viewDidDisappear or viewDidLoad I believe that the Tab Bar Controller has all this cleverness under the hood. Or am I wrong UPDATE I've tested it. If I release the view controller for example ViewControllerA I will get no log message on viewDidDisappear. Only when allocating and initializing..
How would I tint an image programatically on the iPhone? http://stackoverflow.com/questions/1117211/how-would-i-tint-an-image-programatically-on-the-iphone setting the image in IB and calling setNeedsDisplay in my view controller. Update drawRect is not being called. Final update I found an old project that had an imageView set up properly so I could test Ramin's code and it works like a charm Final.. old project that had an imageView set up properly so I could test Ramin's code and it works like a charm Final final update For those of you just learning about Core Graphics here is the simplest thing that could possibly work. In your subclassed..
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 working around the older SDK limitations. I personally have been told by Apple to remove the method call on my next update so I am not yet sure if having a hack for older devices will get through the approval process. share improve this answer..
Expand/collapse section in UITableView http://stackoverflow.com/questions/1938921/expand-collapse-section-in-uitableview
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 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. I assume that this will make my app unusable for anyone on a firmware lower than 4.0. Is there a way..
iPhone App Minus App Store? http://stackoverflow.com/questions/37464/iphone-app-minus-app-store to remove the application later you cannot do so via the standard SpringBoard interface and you'll need to use SSH and update the SpringBoard ssh root@jasoniphone.local rm r Applications AccelerometerGraph.app ssh mobile@jasoniphone.local uicache..
NSDictionary with ordered keys http://stackoverflow.com/questions/376090/nsdictionary-with-ordered-keys into . I could always store a separate array of the keys but that seems kind of kludgey because I'd always have to update the keys of the dictionary as well as the values of the array and make sure they always correspond. Currently I just use..
display image from URL retrieved from ALAsset in iPhone http://stackoverflow.com/questions/3837115/display-image-from-url-retrieved-from-alasset-in-iphone thumb node.view.largeImage if thumb blah blah Thats what I learned while trying to get this working anyway. iOS 5 update When the result block fires seems to be a bit slower with iOS5 maybe single core devices so I couldnt rely on the image..
How to filter NSFetchedResultsController (CoreData) with UISearchDisplayController/UISearchBar http://stackoverflow.com/questions/4471289/how-to-filter-nsfetchedresultscontroller-coredata-with-uisearchdisplaycontroll which applicable FRC to pull the information from. The FRC delegate methods must also figure out which tableView to update. It is surprising how much of this is boilerplate code. Relevant bits of the header file @interface BlahViewController UITableViewController.. #pragma mark #pragma mark Content Filtering void filterContentForSearchText NSString searchText scope NSInteger scope update the filter in this case just blow away the FRC and let lazy evaluation create another with the relevant search info self.searchFetchedResultsController.delegate.. the search result table view to be reloaded. return YES make sure that you use the correct table view when getting updates from the FRC delegate methods void controllerWillChangeContent NSFetchedResultsController controller UITableView tableView..
How to Sync iPhone Core Data with web server, and then push to other devices? http://stackoverflow.com/questions/5035132/how-to-sync-iphone-core-data-with-web-server-and-then-push-to-other-devices merged. The device will have to poll the server without using up too much battery. The local devices will also need to update anything held in memory if when changes are received from the server. Is there anything else I am missing here What kinds..
How do I size a UITextView to its content? http://stackoverflow.com/questions/50467/how-do-i-size-a-uitextview-to-its-content This will not work if auto layout is ON. With auto layout the general approach is to use the sizeThatFits method and update the constant value on a height constraint. CGSize sizeThatShouldFitTheContent _textView sizeThatFits _textView.frame.size..
CADisplayLink OpenGL rendering breaks UIScrollView behaviour http://stackoverflow.com/questions/5944050/cadisplaylink-opengl-rendering-breaks-uiscrollview-behaviour when UIScrollView is dragged on iPhone iphone opengl es share improve this question It's possible that slow updates on the main thread triggered by the CADisplayLink are what's breaking UIScrollView's scrolling behavior here. Your OpenGL.. ES rendering actions on a background thread by using a Grand Central Dispatch serial queue. I did this in my recent update to Molecules source code for which can be found at that link and in testing with using NSRunLoopCommonModes on my CADisplayLink.. same time as the rendering. For this you can create a GCD serial dispatch queue and use it for all of your rendering updates to a particular OpenGL ES context to avoid two actions writing to the context at the same time. Then within your CADisplayLink..
How do I get a background location update every n minutes in my iOS application? http://stackoverflow.com/questions/6347503/how-do-i-get-a-background-location-update-every-n-minutes-in-my-ios-application do I get a background location update every n minutes in my iOS application I'm looking for a way to get a background location update every n minutes in my iOS.. a background location update every n minutes in my iOS application I'm looking for a way to get a background location update every n minutes in my iOS application. I'm using iOS 4.3 and the solution should work for non jailbroken iPhones. I tried.. This works in the background as expected based on the configured properties but it seems not possible to force it to update the location every n minutes NSTimer Does work when the app is running in the foreground but doesn't seem to be designed..
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 executed and stops placed in the code are hit so it's not simply a case of the code somehow not getting used. Bounty update Since I haven't gotten any applicable replies yet I'll extend the bounty deadline for another day or two. Bounty ends in..
iCloud basics and code sample [closed] http://stackoverflow.com/questions/7795629/icloud-basics-and-code-sample else self.documentText @ NSLog @ UIDocument Loaded the following text from the cloud @ self.documentText update textView in delegate... if _delegate respondsToSelector @selector noteDocumentContentsUpdated _delegate noteDocumentContentsUpdated.. UITextView theTextView NSLog @ VC textViewDidChange _document.documentText theTextView.text _document updateChangeCount UIDocumentChangeDone iphone objective c ios cocoa touch icloud share improve this question I just re read..
How do you optionally use iPhone OS 3.0 features in a 2.0 compatible app? http://stackoverflow.com/questions/986589/how-do-you-optionally-use-iphone-os-3-0-features-in-a-2-0-compatible-app app when it runs on a 3.0 device. I don't want to go 3.0 all the way because there are customers who do not want to update yet. I experimented a bit with weak linking of the MapKit.framework weak_framework MapKit . I found it quite cumbersome..
Retrieving a pixel alpha value for a UIImage http://stackoverflow.com/questions/1042830/retrieving-a-pixel-alpha-value-for-a-uiimage between UIKit and Core Graphics i.e is the y axis inverted Or have I misunderstood premultiplied alpha values Update @Nikolai Ruhe's suggestion was key to this. I did not in fact need to translate between UIKit coordinates and Core Graphics..
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 version of Reachability.h and Reachability.m to the project found here https github.com tonymillion Reachability 3 Update the interface section #import Reachability.h Add this to the interface in the .m file of your view controller @interface.. @ www.google.com Internet is reachable internetReachableFoo.reachableBlock ^ Reachability reach Update the UI on the main thread dispatch_async dispatch_get_main_queue ^ NSLog @ Yayyy we have the interwebs Internet is not.. @ Yayyy we have the interwebs Internet is not reachable internetReachableFoo.unreachableBlock ^ Reachability reach Update the UI on the main thread dispatch_async dispatch_get_main_queue ^ NSLog @ Someone broke the internet internetReachableFoo..
How to programmatically send SMS on the iPhone? http://stackoverflow.com/questions/10848/how-to-programmatically-send-sms-on-the-iphone complete automation. ie your program on the iPhone sends a UDP packet to your server which sends the real SMS iOS 4 Update iOS 4 however now provides a viewcontroller you can import into your application. You prepopulate the SMS fields then the.. The MFMessageComposeViewController class is well documented and tutorials show how easy it is to implement. iOS 5 Update iOS 5 includes messaging for iPod touch and iPad devices so while I've not yet tested this myself it may be that all iOS..
Add UIPickerView & a Button in Action sheet - How? http://stackoverflow.com/questions/1262574/add-uipickerview-a-button-in-action-sheet-how Could you please explain how this can be implemented iphone uipickerview share improve this question Update for iOS 7 Apple docs for UIActionSheet UIActionSheet is not designed to be subclassed nor should you add views to its hierarchy..
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 currentDevice setOrientation UIInterfaceOrientationPortrait Are there any documented ways to force the orientation Update I thought I would provide an example as I am not looking for shouldAutorotateToInterfaceOrientation as I have already implemented..
Creating a left-arrow button (like UINavigationBar's “back” style) on a UIToolbar http://stackoverflow.com/questions/227078/creating-a-left-arrow-button-like-uinavigationbars-back-style-on-a-uitoolba won't get very versatile results. Any ideas beyond screenshotting for every size and color scheme I intend to use Update PLEASE STOP dodging the question and suggesting that I shouldn't be asking this and should be using UINavigationBar. My..
Bold & Non-Bold Text In A Single UILabel? http://stackoverflow.com/questions/3586871/bold-non-bold-text-in-a-single-uilabel their apps Examples Screenshot Thanks Dom iphone objective c ipad nsattributedstring share improve this question Update for iOS6 In iOS6 now UILabel UIButton UITextView UITextField and maybe others now support attributed strings which means.. NSParagraphStyle and other constants that will make our life easier. Yay So if we have this string NSString text @ Updated 2012 10 14 21 59 We only need to create the attributed string if _label respondsToSelector @selector setAttributedText.. setDateFormat @ MM dd yyyy hh mm NSString dateString df stringFromDate refreshDate NSString prefix NSLocalizedString @ Updated nil NSString text NSString stringWithFormat @ @ @ prefix dateString df release Create the text layer on demand if _textLayer..
How to customize the background/border colors of a grouped table view cell? http://stackoverflow.com/questions/400965/how-to-customize-the-background-border-colors-of-a-grouped-table-view-cell method. It's a real PITA but I've confirmed with Apple engineers that this is currently the only way. Update Here's the code for that custom bg view. There's a drawing bug that makes the rounded corners look a little funny but we..
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 the bundle . This can also be a great way to distribute code that is used for multiple projects within your company. Update Check out the link featherless added below it is much more recent and all on one page http github.com jverkoey iOS Framework..
“Warning: iPhone apps should include an armv6 architecture” even with build config set http://stackoverflow.com/questions/4198676/warning-iphone-apps-should-include-an-armv6-architecture-even-with-build-conf 'armv6'. Then add a new row with the plus button in the bottom left of the popover and type 'armv7' then click Done Update you should add armv7s to target the iPhone 5 as well. And drop armv6 if building with Xcode 4.5 or higher which no longer..
iPhone - Backgrounding to poll for events http://stackoverflow.com/questions/4656214/iphone-backgrounding-to-poll-for-events wakeup. I don't know if this is the approach of the apps you mentioned before but it works for me. Hope I could help Update After measuring the time of the BG task there was a surprise. The BG Task is limited to 600 seconds. This is the exact minimum.. the expirationHandler from the long running task. Just try it out. Use your Console to see what happens... Have Fun Update 2 Sometimes simplifying things helps. My new approach is this one void applicationDidEnterBackground UIApplication application.. callbacks with having the GPS radio on is sucking my battery down very quickly. Using the approach which I posted in Update 2 is taking nearly no energy. According to the userexperience this is a better approach. Maybe other Apps work like this..
CSS “position: fixed;” into iPad/iPhone? http://stackoverflow.com/questions/4889601/css-position-fixed-into-ipad-iphone but note that the mobile browser world is moving very quickly so tables like this may not stay up to date for long Update iOS 5 and Android 4 are both reported to have position fixed support now. I tested iOS 5 myself in an Apple store today..
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 award the bounty to the best legitimate suggestion critique I see by mid day Tuesday. See below deadline extended. Update Re OMZ's proposal here is what I'm finding Here is the category version h file #import Foundation Foundation.h @interface..
Has anyone implemented the PayPal API through a native iPhone app? http://stackoverflow.com/questions/779423/has-anyone-implemented-the-paypal-api-through-a-native-iphone-app You have to re direct to a web interface. iphone objective c cocoa touch paypal share improve this question Re Update As answered below this code may still be useful for the purchase of physical goods Update Although this code works App Store.. improve this question Re Update As answered below this code may still be useful for the purchase of physical goods Update Although this code works App Store terms won't allow you to use this code within an app. Original Answer I figured this..
How to implement re-ordering of CoreData records? http://stackoverflow.com/questions/1077568/how-to-implement-re-ordering-of-coredata-records moveRowAtIndexPath NSIndexPath fromIndexPath toIndexPath NSIndexPath toIndexPath userDrivenDataModelChange YES ... UPDATE THE MODEL then SAVE CONTEXT ... userDrivenDataModelChange NO and also prevent the notifications to do anything as changes..
How does the iOS app Display Recorder record the screen without using private API? http://stackoverflow.com/questions/11090184/how-does-the-ios-app-display-recorder-record-the-screen-without-using-private-ap for the other mode. It is a tricky app that WILL get pulled from the AppStore so if you want it you better get it now. UPDATE It appears that this app was indeed pulled from the AppStore. If you were lucky enough to grab a copy before it was pulled.. automatically refuses apps that link against the dlsym symbol there are methods that can be used to bypass detection. UPDATE 2 Apparently there is another version of this application in the AppStore now. It is called Disp Recorder and has the same.. 5 but if you have ever wanted a screen recording app on an unjailbroken device you should grab it before it is pulled. UPDATE 3 It looks as if I was very much correct with how this application works. There is an open source implementation of this..
UIImagePickerController and extracting EXIF data from existing photos http://stackoverflow.com/questions/1238838/uiimagepickercontroller-and-extracting-exif-data-from-existing-photos Then we can convert the UIImage into a NSData instance and then use it with the iPhone exif library. UPDATE I gave a test to the library mentioned above and it seems to work. However because of my limited knwoledge about the EXIF.. library you need to define a global variable to get it running as explained in the doc but hum.. BOOL gLogging FALSE UPDATE 2 Answer here iPhone access location information from a photo A UIImage does not encapsulate the meta information so we're.. not encapsulate the meta information so we're stuck for sure no EXIF info will be given through this interface. FINAL UPDATE Ok I managed to get it working at least to geotag properly pictures returned by the picker. Before triggering the UIImagePickerController..
'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 and Settings icon if you don ™t want the OS to interpolate them As per the blog post New Metrics for iOS 7 App Icons . UPDATE As per Apple Guideline App icon OR Icon and Image Sizes Icon dimensions iOS 7 and later Icon dimensions iOS 6.1 and earlier..
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 scale..
A html5 web app for mobile safari to upload images from the Photos.app? http://stackoverflow.com/questions/3891831/a-html5-web-app-for-mobile-safari-to-upload-images-from-the-photos-app
How to customize the background/border colors of a grouped table view cell? http://stackoverflow.com/questions/400965/how-to-customize-the-background-border-colors-of-a-grouped-table-view-cell of the grouped style table view iphone cocoa touch uitableview uitableviewcell share improve this question UPDATE In iPhone OS 3.0 and later UITableViewCell now has a backgroundColor property that makes this really easy especially in..
Can we retrieve the applications currently running in iPhone and iPad http://stackoverflow.com/questions/4312613/can-we-retrieve-the-applications-currently-running-in-iphone-and-ipad currently running in iPhone and iPad Can we retrieve the applications currently running in iPhone and iPad UPDATE Can we do it in jail broken phones Can we do it for an app for CYDIA Store iphone ios4 share improve this question ..
How do I reset after a UIScrollView zoom? http://stackoverflow.com/questions/448285/how-do-i-reset-after-a-uiscrollview-zoom This seems to provide the correct scaling behavior while letting you draw a crisp view at the completion of a zoom. UPDATE 7 23 2010 iPhone OS 3.2 and above have changed the behavior of scroll views in regards to zooming. Now a UIScrollView will..
Changing the size of the UISearchBar TextField? http://stackoverflow.com/questions/556814/changing-the-size-of-the-uisearchbar-textfield can only have 1 subview in its header that's why you need to put the View first then the N B and Search Bar inside it. UPDATE see Beginning iPhone Development from Apress p. 241 of SDK 3 edition. You just disable the index while searching. NSArray..
Store orientation to an array - and compare http://stackoverflow.com/questions/6368618/store-orientation-to-an-array-and-compare They will never have exactly the same values but they can be somewhat the same. Am I at all on the right track here UPDATE I think that maybe Alis answer about using DTW could be the right way for me here. But I'm not that smart apparently so..
Why am I having to manually set my view's frame in viewDidLoad? http://stackoverflow.com/questions/6757018/why-am-i-having-to-manually-set-my-views-frame-in-viewdidload off of where I expect them to be which is the top left corner just under the navigation bar. What am I doing wrong UPDATE turning off all the autosizing stuff on the view changes result #1 to be view frame 0 0 748 1024 That seems a tiny bit closer..
Has anyone implemented the PayPal API through a native iPhone app? http://stackoverflow.com/questions/779423/has-anyone-implemented-the-paypal-api-through-a-native-iphone-app key. Does this sound right and has anyone got or seen any sample code I have to think this is a common piece of code. UPDATE Will Apple allow this It is a charity app so I am assuming there is no issue. Re UPDATE I assumed wrong. Apple will not.. is a common piece of code. UPDATE Will Apple allow this It is a charity app so I am assuming there is no issue. Re UPDATE I assumed wrong. Apple will not allow payments directly within apps using paypal. You have to re direct to a web interface...
Testing CoreLocation on iPhone Simulator http://stackoverflow.com/questions/802156/testing-corelocation-on-iphone-simulator CoreLocation on iPhone Simulator UPDATE As of iOS 5 and Xcode 4.1 is is now possible to test location in the simulator and even define routes. See http developer.apple.com..
Reducing piracy of iPhone applications http://stackoverflow.com/questions/846309/reducing-piracy-of-iphone-applications answers about how piracy is inevitable etc. iphone piracy piracy prevention share improve this question UPDATE Please visit and read Thanks to chpwn in the comments. Code that's way too old 11th May 2009 For now there's an easier way..
View Controllers: How to switch between views programmatically? http://stackoverflow.com/questions/910994/view-controllers-how-to-switch-between-views-programmatically or viewDidLoad I believe that the Tab Bar Controller has all this cleverness under the hood. Or am I wrong UPDATE I've tested it. If I release the view controller for example ViewControllerA I will get no log message on viewDidDisappear...
|