iphone Programming Glossary: since
UIScrollView horizontal paging like Mobile Safari tabs http://stackoverflow.com/questions/1220354/uiscrollview-horizontal-paging-like-mobile-safari-tabs you need them to be and set their centers based on multiples of the UIScrollView 's width. Then since you want to see the other pages of course set clipsToBounds to NO as mhjoy stated. The trick part now..
How to develop or migrate apps for iPhone 5 screen resolution? http://stackoverflow.com/questions/12395200/how-to-develop-or-migrate-apps-for-iphone-5-screen-resolution will get 960 px with black margins on top and bottom . Test your app and hopefully do nothing else since everything should work magically if you had set auto resizing masks properly. If you didn't adjust your..
How can I get a writable path on the iPhone? http://stackoverflow.com/questions/1567134/how-can-i-get-a-writable-path-on-the-iphone iTunes using a device older than 3.2 the iPad the NSLibraryDirectory constant has been available since iPhoneOS 2.0 and so can be used for builds targeting 3.0 or even earlier if you are still doing that..
Detecting which UIButton was pressed in a UITableView http://stackoverflow.com/questions/1802707/detecting-which-uibutton-was-pressed-in-a-uitableview row button.tag What's important to note is that I can't set the tag in the creation of the cell since the cell might be dequeued instead. It feels very dirty. There must be a better way. iphone uitableview..
Programmatically get own phone number in iOS http://stackoverflow.com/questions/193182/programmatically-get-own-phone-number-in-ios
How do I associate file types with an iPhone application? http://stackoverflow.com/questions/2774343/how-do-i-associate-file-types-with-an-iphone-application learned that apps could be associated with custom URL protocols. That was almost one year ago and since then Apple introduced 'Document Support' which goes a step further and allows apps to associate with..
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 That is why 4.0 3.2 are your only choices for SDKs. That is also why your project is now broken since the SDK it was previously mapped to is deprecated gones ville. But 3 is a magic number Relax. You can..
Prefixing property names with an underscore in Objective C [duplicate] http://stackoverflow.com/questions/3521254/prefixing-property-names-with-an-underscore-in-objective-c same name as the property indicates that's the pattern they expect you to follow. No matter what since objects still have to send messages to themselves to access properties it's hard to confuse when you're..
Bold & Non-Bold Text In A Single UILabel? http://stackoverflow.com/questions/3586871/bold-non-bold-text-in-a-single-uilabel CATextLayer alloc init _textLayer.font UIFont boldSystemFontOfSize 13 .fontName not needed since `string` property will be an NSAttributedString _textLayer.backgroundColor UIColor clearColor .CGColor..
“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 apps should include an armv6 architecture&rdquo even with build config set It's been a while since I've had to adjust project build settings. After upgrading to a recent SDK I'm having trouble building..
What's the best way to communicate between view controllers? http://stackoverflow.com/questions/569940/whats-the-best-way-to-communicate-between-view-controllers notes that they have left on the web. It includes lecture notes assignments and sample code and since the course was given by Apple dev's I definitely consider it to be from the horse's mouth . Class Website..
How do I create delegates in Objective-C? http://stackoverflow.com/questions/626898/how-do-i-create-delegates-in-objective-c delegate property itself is typically declared weak in ARC or assign pre ARC to avoid retain loops since the delegate of an object often holds a strong reference to that object. For example a view controller..
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 again before there is no time remaining to avoid the background task being killed. This does work since location is one of the three allowed types of background execution . Note Did loose some time by testing..
Understanding reference counting with Cocoa and Objective-C http://stackoverflow.com/questions/6578/understanding-reference-counting-with-cocoa-and-objective-c return s but we've upped its reference count. The caller shouldn't be responsible for releasing it since we're the ones that created it. If we call release however the reference count will hit zero and bad..
UIDevice uniqueIdentifier Deprecated - What To Do Now? http://stackoverflow.com/questions/6993325/uidevice-uniqueidentifier-deprecated-what-to-do-now stay the same when the user uninstalls and re installs the app. This requires a bit of effort since the most reliable per device identifier seems to be the MAC address. You could query the MAC and use.. if the interface has no IP is down. Edit 2 As was pointed out by others the preferred solution since iOS 6 is UIDevice identifierForVendor . In most cases you should be able use it as a drop in replacement..
performSelector may cause a leak because its selector is unknown http://stackoverflow.com/questions/7017281/performselector-may-cause-a-leak-because-its-selector-is-unknown hand side simply tells the compiler that you know what you're doing and not to generate a warning since the pointer types don't match . Finally you call the function pointer. Complex Example When the selector..
Is there a good charting library for iPhone? [closed] http://stackoverflow.com/questions/769749/is-there-a-good-charting-library-for-iphone in use in several shipping iPhone and OS X applications. Edit 2 10 Core Plot has come a long way since I first posted the summary. The framework now has bar charts including horizontal bar charts I believe..
iPhone Data Usage Tracking/Monitoring http://stackoverflow.com/questions/7946699/iphone-data-usage-tracking-monitoring pdp_ip0 is your WWAN interface. There is no good way to get information wifi cellular network data since particular date time data statistic ifa_data ifi_obytes and ifa_data ifi_ibytes are stored from previous..
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 party control that could be used I could write one myself but I'd rather pick up something ready since this is a departure on the original project plans . iphone cocoa touch interface uikit calendar share..
Delete/Reset all entries in Core Data? http://stackoverflow.com/questions/1077810/delete-reset-all-entries-in-core-data deleting files pointed by storeURLs is not enough. You'll leave the external record files behind. Since the naming scheme of these external record files is not public I don't have a universal solution yet...
HTML character decoding in Objective-C / Cocoa Touch http://stackoverflow.com/questions/1105169/html-character-decoding-in-objective-c-cocoa-touch great ways to do this in objective C but this stack overflow question might be of some help. Edit Since answering this some two years ago there are some great solutions see @Michael Waterfall's answer below...
Determining if an iPhone is Jail broken Programatically http://stackoverflow.com/questions/1140856/determining-if-an-iphone-is-jail-broken-programatically 2008 11 detection.html In short the cracking usually requires changing the Info.plist. Since it's regular file you have access to it's pretty easy to determine such changes. share improve this..
Resizing UIimages pulled from the Camera also ROTATES the UIimage? http://stackoverflow.com/questions/1260249/resizing-uiimages-pulled-from-the-camera-also-rotates-the-uiimage from the problem that it is not thread safe since you're using UIGraphicsBeginImageContext . Since the above code only uses CG functions you're all set. I also have a similar function to resize and do..
Declaration/definition of variables locations in ObjectiveC? http://stackoverflow.com/questions/12632285/declaration-definition-of-variables-locations-in-objectivec OtherClass.m int v myClass.myVar assuming myClass is an object of type MyClass. myClass.myVar v 1 Since Xcode 4.4 you don't have to declare an instance variable yourself anymore and you can skip @synthesize..
Programmatically Request Access to Contacts http://stackoverflow.com/questions/12648244/programmatically-request-access-to-contacts Request Access to Contacts Since updating to iOS 6 I've noticed that my code to add a contact to iPhone's address book no longer works...
Use CoreData or SQLite on iPhone? [closed] http://stackoverflow.com/questions/1318467/use-coredata-or-sqlite-on-iphone CoreData or SQLite on iPhone closed Since CoreData has become available for the iPhone in OS 3.0 is it meant to be the answer to data persistence..
Get to UIViewController from UIView on iPhone? http://stackoverflow.com/questions/1340434/get-to-uiviewcontroller-from-uiview-on-iphone is a reverse reference iphone cocoa touch uiview uiviewcontroller share improve this question Since this has been the accepted answer for a long time I feel I need to rectify it with a better answer...
iOS crash reports: atos not working as expected http://stackoverflow.com/questions/13574933/ios-crash-reports-atos-not-working-as-expected section at the very front of the line which contains your executable. Usually the first entry . Since in the past value of the slide was equal to value of the load address this always worked. But since..
AES Encryption for an NSString on the iPhone http://stackoverflow.com/questions/1400246/aes-encryption-for-an-nsstring-on-the-iphone kCCEncrypt kCCDecrypt. iphone objective c encryption nsstring aes share improve this question Since you haven't posted any code it's difficult to know exactly which problems you're encountering. However..
Cropping a UIImage http://stackoverflow.com/questions/158914/cropping-a-uiimage Theory 1 I achieve the cropping by drawing into an offscreen image context of my target size. Since I want the center portion of the image I set the CGRect argument passed to drawInRect to something that's..
How to access SOAP services from iPhone http://stackoverflow.com/questions/204465/how-to-access-soap-services-from-iphone write a library using the functionality that is present in the iPhone SDK to access SOAP services Since the service I need to access is exposed by another party and they only expose it as SOAP it's unfortunately..
How does Apple know you are using private API? http://stackoverflow.com/questions/2842357/how-does-apple-know-you-are-using-private-api and check if you've used some undocumented Objective C methods such as UIDevice setOrientation . Since selectors are independent from the class you're messaging even if your custom class defines setOrientation..
Build fat static library (device + simulator) using Xcode and SDK 4+ http://stackoverflow.com/questions/3520977/build-fat-static-library-device-simulator-using-xcode-and-sdk-4 stackoverflow.com questions 2793392 how do i compile a static library fat for armv6 armv7 and i386 Since Apple's latest changes the Simulator part isn't the same as the arm6 arm7 difference any more it's a..
UITextView with Syntax Highlighting [duplicate] http://stackoverflow.com/questions/3642540/uitextview-with-syntax-highlighting like in UITextView but require a whole new level of headache. Still private. CoreText Framework Since iOS 3.2 a very very good rendering engine. But that's it. Can directly layout and render NSAttributesString..
How to determine the content size of a UIWebView? http://stackoverflow.com/questions/3936041/how-to-determine-the-content-size-of-a-uiwebview the wrong frame size by the fitting size. This sounds terrible but it's actually not that bad. Since we do both frame changes right after each other the view isn't updated and doesn't flicker. Of course..
How do I reset after a UIScrollView zoom? http://stackoverflow.com/questions/448285/how-do-i-reset-after-a-uiscrollview-zoom zoom operation it sets the transform of the content view to whatever the overall scale factor is. Since you've manually redrawn your view at the last scale factor it compounds the scaling which is what you're..
What's the easiest way to resize/optimize an image size with the iPhone SDK? http://stackoverflow.com/questions/612131/whats-the-easiest-way-to-resize-optimize-an-image-size-with-the-iphone-sdk disk. Some of those images are pretty big in size widths larger than 500 pixels for instance . Since the iPhone doesn't even have a big enough display to show the image in its original size I'm planning..
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 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...
performSelector may cause a leak because its selector is unknown http://stackoverflow.com/questions/7017281/performselector-may-cause-a-leak-because-its-selector-is-unknown casting but really it'd be better to simply use the IMP and function pointer methodology above. Since consumed parameters are rarely an issue this isn't likely to come up. Static Selectors Interestingly..
UIScrollView horizontal paging like Mobile Safari tabs http://stackoverflow.com/questions/1220354/uiscrollview-horizontal-paging-like-mobile-safari-tabs the UIScrollView . Then set your subview's sizes however big you need them to be and set their centers based on multiples of the UIScrollView 's width. Then since you want to see the other pages of course set clipsToBounds to NO as mhjoy stated. The trick part now is getting it to scroll when the user starts the drag outside..
How to develop or migrate apps for iPhone 5 screen resolution? http://stackoverflow.com/questions/12395200/how-to-develop-or-migrate-apps-for-iphone-5-screen-resolution This is how you get 1136 px screen height without it you will get 960 px with black margins on top and bottom . Test your app and hopefully do nothing else since everything should work magically if you had set auto resizing masks properly. If you didn't adjust your view layouts with proper auto resizing masks or look into..
How can I get a writable path on the iPhone? http://stackoverflow.com/questions/1567134/how-can-i-get-a-writable-path-on-the-iphone 0 Note that even though the user cannot see files in iTunes using a device older than 3.2 the iPad the NSLibraryDirectory constant has been available since iPhoneOS 2.0 and so can be used for builds targeting 3.0 or even earlier if you are still doing that . Also the user will not be able to see anything unless you..
Detecting which UIButton was pressed in a UITableView http://stackoverflow.com/questions/1802707/detecting-which-uibutton-was-pressed-in-a-uitableview id sender UIButton button UIButton sender int row button.tag What's important to note is that I can't set the tag in the creation of the cell since the cell might be dequeued instead. It feels very dirty. There must be a better way. iphone uitableview uitableviewcell share improve this question In Apple's..
Programmatically get own phone number in iOS http://stackoverflow.com/questions/193182/programmatically-get-own-phone-number-in-ios
How do I associate file types with an iPhone application? http://stackoverflow.com/questions/2774343/how-do-i-associate-file-types-with-an-iphone-application iPhone app with file types. In this informative question I learned that apps could be associated with custom URL protocols. That was almost one year ago and since then Apple introduced 'Document Support' which goes a step further and allows apps to associate with file types. There is a lot of talk in the documentation about..
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 here iPad only and universal apps should use the 3.2 SDK. That is why 4.0 3.2 are your only choices for SDKs. That is also why your project is now broken since the SDK it was previously mapped to is deprecated gones ville. But 3 is a magic number Relax. You can still target devices running iPhone OS 3.0 but not lower ...
Prefixing property names with an underscore in Objective C [duplicate] http://stackoverflow.com/questions/3521254/prefixing-property-names-with-an-underscore-in-objective-c accessors for a property will access the ivar with the same name as the property indicates that's the pattern they expect you to follow. No matter what since objects still have to send messages to themselves to access properties it's hard to confuse when you're accessing a property or when you're accessing its backing..
Bold & Non-Bold Text In A Single UILabel? http://stackoverflow.com/questions/3586871/bold-non-bold-text-in-a-single-uilabel release Create the text layer on demand if _textLayer _textLayer CATextLayer alloc init _textLayer.font UIFont boldSystemFontOfSize 13 .fontName not needed since `string` property will be an NSAttributedString _textLayer.backgroundColor UIColor clearColor .CGColor _textLayer.wrapped NO CALayer layer self.navigationController.toolbar.layer..
“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 Warning iPhone apps should include an armv6 architecture&rdquo even with build config set It's been a while since I've had to adjust project build settings. After upgrading to a recent SDK I'm having trouble building my ad hoc distribution configuration. Build generates this..
What's the best way to communicate between view controllers? http://stackoverflow.com/questions/569940/whats-the-best-way-to-communicate-between-view-controllers One of the resources I'm using is Stanford's CS193P class notes that they have left on the web. It includes lecture notes assignments and sample code and since the course was given by Apple dev's I definitely consider it to be from the horse's mouth . Class Website http www.stanford.edu class cs193p cgi bin index.php Lecture..
How do I create delegates in Objective-C? http://stackoverflow.com/questions/626898/how-do-i-create-delegates-in-objective-c windowDidMove self delegate windowDidMove notification The delegate property itself is typically declared weak in ARC or assign pre ARC to avoid retain loops since the delegate of an object often holds a strong reference to that object. For example a view controller is often the delegate of a view it contains. To define your..
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 larger the location manager should be enabled and disabled again before there is no time remaining to avoid the background task being killed. This does work since location is one of the three allowed types of background execution . Note Did loose some time by testing this in the simulator where it doesn't work works fine..
Understanding reference counting with Cocoa and Objective-C http://stackoverflow.com/questions/6578/understanding-reference-counting-with-cocoa-and-objective-c alloc initWithString @ Hello World Now what We want to return s but we've upped its reference count. The caller shouldn't be responsible for releasing it since we're the ones that created it. If we call release however the reference count will hit zero and bad memory will be returned to the caller. The answer is to call..
UIDevice uniqueIdentifier Deprecated - What To Do Now? http://stackoverflow.com/questions/6993325/uidevice-uniqueidentifier-deprecated-what-to-do-now time. But you might want it to be not unique i. e. it should stay the same when the user uninstalls and re installs the app. This requires a bit of effort since the most reliable per device identifier seems to be the MAC address. You could query the MAC and use that as UUID. Edit One needs to always query the MAC of the.. guess the best bet is with en0 . The MAC is always present even if the interface has no IP is down. Edit 2 As was pointed out by others the preferred solution since iOS 6 is UIDevice identifierForVendor . In most cases you should be able use it as a drop in replacement to the old UIDevice uniqueIdentifier but a UUID that is..
performSelector may cause a leak because its selector is unknown http://stackoverflow.com/questions/7017281/performselector-may-cause-a-leak-because-its-selector-is-unknown . This is handled in the third line the void on the right hand side simply tells the compiler that you know what you're doing and not to generate a warning since the pointer types don't match . Finally you call the function pointer. Complex Example When the selector takes arguments or returns a value you'll have to change..
Is there a good charting library for iPhone? [closed] http://stackoverflow.com/questions/769749/is-there-a-good-charting-library-for-iphone It's getting pretty close to useable and is currently in use in several shipping iPhone and OS X applications. Edit 2 10 Core Plot has come a long way since I first posted the summary. The framework now has bar charts including horizontal bar charts I believe axis labels including aribrarty rotations and fills and backgrounds..
iPhone Data Usage Tracking/Monitoring http://stackoverflow.com/questions/7946699/iphone-data-usage-tracking-monitoring interface. In general en0 is your Wi Fi interface and pdp_ip0 is your WWAN interface. There is no good way to get information wifi cellular network data since particular date time data statistic ifa_data ifi_obytes and ifa_data ifi_ibytes are stored from previous device reboot. i don't know why but ifi_opackets and ifi_ipackets..
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 of the box. Is that true If so does anyone know of a third party control that could be used I could write one myself but I'd rather 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..
Delete/Reset all entries in Core Data? http://stackoverflow.com/questions/1077810/delete-reset-all-entries-in-core-data
HTML character decoding in Objective-C / Cocoa Touch http://stackoverflow.com/questions/1105169/html-character-decoding-in-objective-c-cocoa-touch
Determining if an iPhone is Jail broken Programatically http://stackoverflow.com/questions/1140856/determining-if-an-iphone-is-jail-broken-programatically
Resizing UIimages pulled from the Camera also ROTATES the UIimage? http://stackoverflow.com/questions/1260249/resizing-uiimages-pulled-from-the-camera-also-rotates-the-uiimage M_PI 180 The answer Daniel gave is also correct but it suffers from the problem that it is not thread safe since you're using UIGraphicsBeginImageContext . Since the above code only uses CG functions you're all set. I also have a similar function to resize and do proper aspect fill on images let me know if that's what you're..
Declaration/definition of variables locations in ObjectiveC? http://stackoverflow.com/questions/12632285/declaration-definition-of-variables-locations-in-objectivec you can also use the dot syntax to access properties OtherClass.m int v myClass.myVar assuming myClass is an object of type MyClass. myClass.myVar v 1 Since Xcode 4.4 you don't have to declare an instance variable yourself anymore and you can skip @synthesize too. If you don't declare an ivar the compiler will add it..
Programmatically Request Access to Contacts http://stackoverflow.com/questions/12648244/programmatically-request-access-to-contacts Request Access to Contacts Since updating to iOS 6 I've noticed that my code to add a contact to iPhone's address book no longer works. I believe this is a permission related problem since Apple..
Use CoreData or SQLite on iPhone? [closed] http://stackoverflow.com/questions/1318467/use-coredata-or-sqlite-on-iphone CoreData or SQLite on iPhone closed Since CoreData has become available for the iPhone in OS 3.0 is it meant to be the answer to data persistence and replace all need for direct SQLite What reasons exist..
Get to UIViewController from UIView on iPhone? http://stackoverflow.com/questions/1340434/get-to-uiviewcontroller-from-uiview-on-iphone to its UIView via self view but I was wondering if there is a reverse reference iphone cocoa touch uiview uiviewcontroller share improve this question Since this has been the accepted answer for a long time I feel I need to rectify it with a better answer. Some comments on the need Your view should not need to access..
iOS crash reports: atos not working as expected http://stackoverflow.com/questions/13574933/ios-crash-reports-atos-not-working-as-expected can be is the first address showing in the Binary Images section at the very front of the line which contains your executable. Usually the first entry . Since in the past value of the slide was equal to value of the load address this always worked. But since Apple introduced Address space layout randomization beginning..
AES Encryption for an NSString on the iPhone http://stackoverflow.com/questions/1400246/aes-encryption-for-an-nsstring-on-the-iphone decrypt an encrypted string but I hope that's as simple as kCCEncrypt kCCDecrypt. iphone objective c encryption nsstring aes share improve this question Since you haven't posted any code it's difficult to know exactly which problems you're encountering. However the blog post you link to does seem to work pretty decently.....
Cropping a UIImage http://stackoverflow.com/questions/158914/cropping-a-uiimage two different theories and I'm wondering if either is on base. Theory 1 I achieve the cropping by drawing into an offscreen image context of my target size. Since I want the center portion of the image I set the CGRect argument passed to drawInRect to something that's larger than the bounds of my image context. I was hoping..
How to access SOAP services from iPhone http://stackoverflow.com/questions/204465/how-to-access-soap-services-from-iphone be the best approach Any best practices Did someone already write a library using the functionality that is present in the iPhone SDK to access SOAP services Since the service I need to access is exposed by another party and they only expose it as SOAP it's unfortunately not an option to switch to another type of interface..
How does Apple know you are using private API? http://stackoverflow.com/questions/2842357/how-does-apple-know-you-are-using-private-api and therefore Apple could extract the content from there and check if you've used some undocumented Objective C methods such as UIDevice setOrientation . Since selectors are independent from the class you're messaging even if your custom class defines setOrientation irrelevant to UIDevice there will be a possibility of..
Build fat static library (device + simulator) using Xcode and SDK 4+ http://stackoverflow.com/questions/3520977/build-fat-static-library-device-simulator-using-xcode-and-sdk-4 on the arm6 vs arm7 part but ignored the i386 part http stackoverflow.com questions 2793392 how do i compile a static library fat for armv6 armv7 and i386 Since Apple's latest changes the Simulator part isn't the same as the arm6 arm7 difference any more it's a different problem see above iphone xcode share improve..
UITextView with Syntax Highlighting [duplicate] http://stackoverflow.com/questions/3642540/uitextview-with-syntax-highlighting without private API and a lot of headaches. Editing would work like in UITextView but require a whole new level of headache. Still private. CoreText Framework Since iOS 3.2 a very very good rendering engine. But that's it. Can directly layout and render NSAttributesString s. However there is no user interaction. No text selection..
How to determine the content size of a UIWebView? http://stackoverflow.com/questions/3936041/how-to-determine-the-content-size-of-a-uiwebview size prior to sending sizeThatFits . After that we can correct the wrong frame size by the fitting size. This sounds terrible but it's actually not that bad. Since we do both frame changes right after each other the view isn't updated and doesn't flicker. Of course we have to wait until the content has been loaded so we put..
How do I reset after a UIScrollView zoom? http://stackoverflow.com/questions/448285/how-do-i-reset-after-a-uiscrollview-zoom appear to monitor the content view transform so on the next zoom operation it sets the transform of the content view to whatever the overall scale factor is. Since you've manually redrawn your view at the last scale factor it compounds the scaling which is what you're seeing. As a workaround I use a UIView subclass for my..
What's the easiest way to resize/optimize an image size with the iPhone SDK? http://stackoverflow.com/questions/612131/whats-the-easiest-way-to-resize-optimize-an-image-size-with-the-iphone-sdk files from the network and saving them to the local iPhone disk. Some of those images are pretty big in size widths larger than 500 pixels for instance . Since the iPhone doesn't even have a big enough display to show the image in its original size I'm planning on resizing the image to something a bit smaller to save on..
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 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 most effort..
performSelector may cause a leak because its selector is unknown http://stackoverflow.com/questions/7017281/performselector-may-cause-a-leak-because-its-selector-is-unknown and crash. There are ways to work around this with bridged casting but really it'd be better to simply use the IMP and function pointer methodology above. Since consumed parameters are rarely an issue this isn't likely to come up. Static Selectors Interestingly the compiler will not complain about selectors declared statically..
How to develop or migrate apps for iPhone 5 screen resolution? http://stackoverflow.com/questions/12395200/how-to-develop-or-migrate-apps-for-iphone-5-screen-resolution without it you will get 960 px with black margins on top and bottom . Test your app and hopefully do nothing else since everything should work magically if you had set auto resizing masks properly. If you didn't adjust your view layouts with..
How can I get a writable path on the iPhone? http://stackoverflow.com/questions/1567134/how-can-i-get-a-writable-path-on-the-iphone cannot see files in iTunes using a device older than 3.2 the iPad the NSLibraryDirectory constant has been available since iPhoneOS 2.0 and so can be used for builds targeting 3.0 or even earlier if you are still doing that . Also the user will..
Detecting which UIButton was pressed in a UITableView http://stackoverflow.com/questions/1802707/detecting-which-uibutton-was-pressed-in-a-uitableview UIButton sender int row button.tag What's important to note is that I can't set the tag in the creation of the cell since the cell might be dequeued instead. It feels very dirty. There must be a better way. iphone uitableview uitableviewcell..
Programmatically get own phone number in iOS http://stackoverflow.com/questions/193182/programmatically-get-own-phone-number-in-ios
How do I associate file types with an iPhone application? http://stackoverflow.com/questions/2774343/how-do-i-associate-file-types-with-an-iphone-application question I learned that apps could be associated with custom URL protocols. That was almost one year ago and since then Apple introduced 'Document Support' which goes a step further and allows apps to associate with file types. There is..
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 use the 3.2 SDK. That is why 4.0 3.2 are your only choices for SDKs. That is also why your project is now broken since the SDK it was previously mapped to is deprecated gones ville. But 3 is a magic number Relax. You can still target devices..
Prefixing property names with an underscore in Objective C [duplicate] http://stackoverflow.com/questions/3521254/prefixing-property-names-with-an-underscore-in-objective-c the ivar with the same name as the property indicates that's the pattern they expect you to follow. No matter what since objects still have to send messages to themselves to access properties it's hard to confuse when you're accessing a property..
Bold & Non-Bold Text In A Single UILabel? http://stackoverflow.com/questions/3586871/bold-non-bold-text-in-a-single-uilabel if _textLayer _textLayer CATextLayer alloc init _textLayer.font UIFont boldSystemFontOfSize 13 .fontName not needed since `string` property will be an NSAttributedString _textLayer.backgroundColor UIColor clearColor .CGColor _textLayer.wrapped..
“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 Warning iPhone apps should include an armv6 architecture&rdquo even with build config set It's been a while since I've had to adjust project build settings. After upgrading to a recent SDK I'm having trouble building my ad hoc distribution..
What's the best way to communicate between view controllers? http://stackoverflow.com/questions/569940/whats-the-best-way-to-communicate-between-view-controllers CS193P class notes that they have left on the web. It includes lecture notes assignments and sample code and since the course was given by Apple dev's I definitely consider it to be from the horse's mouth . Class Website http www.stanford.edu..
How do I create delegates in Objective-C? http://stackoverflow.com/questions/626898/how-do-i-create-delegates-in-objective-c notification The delegate property itself is typically declared weak in ARC or assign pre ARC to avoid retain loops since the delegate of an object often holds a strong reference to that object. For example a view controller is often the delegate..
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 enabled and disabled again before there is no time remaining to avoid the background task being killed. This does work since location is one of the three allowed types of background execution . Note Did loose some time by testing this in the simulator..
Understanding reference counting with Cocoa and Objective-C http://stackoverflow.com/questions/6578/understanding-reference-counting-with-cocoa-and-objective-c Now what We want to return s but we've upped its reference count. The caller shouldn't be responsible for releasing it since we're the ones that created it. If we call release however the reference count will hit zero and bad memory will be returned..
UIDevice uniqueIdentifier Deprecated - What To Do Now? http://stackoverflow.com/questions/6993325/uidevice-uniqueidentifier-deprecated-what-to-do-now unique i. e. it should stay the same when the user uninstalls and re installs the app. This requires a bit of effort since the most reliable per device identifier seems to be the MAC address. You could query the MAC and use that as UUID. Edit.. is always present even if the interface has no IP is down. Edit 2 As was pointed out by others the preferred solution since iOS 6 is UIDevice identifierForVendor . In most cases you should be able use it as a drop in replacement to the old UIDevice..
performSelector may cause a leak because its selector is unknown http://stackoverflow.com/questions/7017281/performselector-may-cause-a-leak-because-its-selector-is-unknown void on the right hand side simply tells the compiler that you know what you're doing and not to generate a warning since the pointer types don't match . Finally you call the function pointer. Complex Example When the selector takes arguments..
Is there a good charting library for iPhone? [closed] http://stackoverflow.com/questions/769749/is-there-a-good-charting-library-for-iphone and is currently in use in several shipping iPhone and OS X applications. Edit 2 10 Core Plot has come a long way since I first posted the summary. The framework now has bar charts including horizontal bar charts I believe axis labels including..
iPhone Data Usage Tracking/Monitoring http://stackoverflow.com/questions/7946699/iphone-data-usage-tracking-monitoring Wi Fi interface and pdp_ip0 is your WWAN interface. There is no good way to get information wifi cellular network data since particular date time data statistic ifa_data ifi_obytes and ifa_data ifi_ibytes are stored from previous device reboot...
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 know of a third party control that could be used I could write one myself but I'd rather pick up something ready since this is a departure on the original project plans . iphone cocoa touch interface uikit calendar share improve this question..
Delete/Reset all entries in Core Data? http://stackoverflow.com/questions/1077810/delete-reset-all-entries-in-core-data and OS X 10.7 simply deleting files pointed by storeURLs is not enough. You'll leave the external record files behind. Since the naming scheme of these external record files is not public I don't have a universal solution yet. an0 May 8 '12 at 23..
HTML character decoding in Objective-C / Cocoa Touch http://stackoverflow.com/questions/1105169/html-character-decoding-in-objective-c-cocoa-touch I don't know of any great ways to do this in objective C but this stack overflow question might be of some help. Edit Since answering this some two years ago there are some great solutions see @Michael Waterfall's answer below. share improve this..
Determining if an iPhone is Jail broken Programatically http://stackoverflow.com/questions/1140856/determining-if-an-iphone-is-jail-broken-programatically
Resizing UIimages pulled from the Camera also ROTATES the UIimage? http://stackoverflow.com/questions/1260249/resizing-uiimages-pulled-from-the-camera-also-rotates-the-uiimage correct but it suffers from the problem that it is not thread safe since you're using UIGraphicsBeginImageContext . Since the above code only uses CG functions you're all set. I also have a similar function to resize and do proper aspect fill..
Declaration/definition of variables locations in ObjectiveC? http://stackoverflow.com/questions/12632285/declaration-definition-of-variables-locations-in-objectivec to access properties OtherClass.m int v myClass.myVar assuming myClass is an object of type MyClass. myClass.myVar v 1 Since Xcode 4.4 you don't have to declare an instance variable yourself anymore and you can skip @synthesize too. If you don't..
Programmatically Request Access to Contacts http://stackoverflow.com/questions/12648244/programmatically-request-access-to-contacts Request Access to Contacts Since updating to iOS 6 I've noticed that my code to add a contact to iPhone's address book no longer works. I believe this is..
Use CoreData or SQLite on iPhone? [closed] http://stackoverflow.com/questions/1318467/use-coredata-or-sqlite-on-iphone CoreData or SQLite on iPhone closed Since CoreData has become available for the iPhone in OS 3.0 is it meant to be the answer to data persistence and replace all..
Get to UIViewController from UIView on iPhone? http://stackoverflow.com/questions/1340434/get-to-uiviewcontroller-from-uiview-on-iphone wondering if there is a reverse reference iphone cocoa touch uiview uiviewcontroller share improve this question Since this has been the accepted answer for a long time I feel I need to rectify it with a better answer. Some comments on the..
iOS crash reports: atos not working as expected http://stackoverflow.com/questions/13574933/ios-crash-reports-atos-not-working-as-expected in the Binary Images section at the very front of the line which contains your executable. Usually the first entry . Since in the past value of the slide was equal to value of the load address this always worked. But since Apple introduced Address..
AES Encryption for an NSString on the iPhone http://stackoverflow.com/questions/1400246/aes-encryption-for-an-nsstring-on-the-iphone that's as simple as kCCEncrypt kCCDecrypt. iphone objective c encryption nsstring aes share improve this question Since you haven't posted any code it's difficult to know exactly which problems you're encountering. However the blog post you..
Cropping a UIImage http://stackoverflow.com/questions/158914/cropping-a-uiimage if either is on base. Theory 1 I achieve the cropping by drawing into an offscreen image context of my target size. Since I want the center portion of the image I set the CGRect argument passed to drawInRect to something that's larger than the..
How to access SOAP services from iPhone http://stackoverflow.com/questions/204465/how-to-access-soap-services-from-iphone Did someone already write a library using the functionality that is present in the iPhone SDK to access SOAP services Since the service I need to access is exposed by another party and they only expose it as SOAP it's unfortunately not an option..
How does Apple know you are using private API? http://stackoverflow.com/questions/2842357/how-does-apple-know-you-are-using-private-api content from there and check if you've used some undocumented Objective C methods such as UIDevice setOrientation . Since selectors are independent from the class you're messaging even if your custom class defines setOrientation irrelevant to..
Build fat static library (device + simulator) using Xcode and SDK 4+ http://stackoverflow.com/questions/3520977/build-fat-static-library-device-simulator-using-xcode-and-sdk-4 the i386 part http stackoverflow.com questions 2793392 how do i compile a static library fat for armv6 armv7 and i386 Since Apple's latest changes the Simulator part isn't the same as the arm6 arm7 difference any more it's a different problem see..
UITextView with Syntax Highlighting [duplicate] http://stackoverflow.com/questions/3642540/uitextview-with-syntax-highlighting Editing would work like in UITextView but require a whole new level of headache. Still private. CoreText Framework Since iOS 3.2 a very very good rendering engine. But that's it. Can directly layout and render NSAttributesString s. However there..
How to determine the content size of a UIWebView? http://stackoverflow.com/questions/3936041/how-to-determine-the-content-size-of-a-uiwebview that we can correct the wrong frame size by the fitting size. This sounds terrible but it's actually not that bad. Since we do both frame changes right after each other the view isn't updated and doesn't flicker. Of course we have to wait until..
How do I reset after a UIScrollView zoom? http://stackoverflow.com/questions/448285/how-do-i-reset-after-a-uiscrollview-zoom so on the next zoom operation it sets the transform of the content view to whatever the overall scale factor is. Since you've manually redrawn your view at the last scale factor it compounds the scaling which is what you're seeing. As a workaround..
What's the easiest way to resize/optimize an image size with the iPhone SDK? http://stackoverflow.com/questions/612131/whats-the-easiest-way-to-resize-optimize-an-image-size-with-the-iphone-sdk to the local iPhone disk. Some of those images are pretty big in size widths larger than 500 pixels for instance . Since the iPhone doesn't even have a big enough display to show the image in its original size I'm planning on resizing the image..
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 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..
performSelector may cause a leak because its selector is unknown http://stackoverflow.com/questions/7017281/performselector-may-cause-a-leak-because-its-selector-is-unknown this with bridged casting but really it'd be better to simply use the IMP and function pointer methodology above. Since consumed parameters are rarely an issue this isn't likely to come up. Static Selectors Interestingly the compiler will not..
|