¡@

Home 

2014/10/15 ¤U¤È 10:14:16

iphone Programming Glossary: so

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

be down and relying on a 3rd party seems bad and while I could check to see for a response from some other websites if Google didn't respond it does seem wasteful and an unnecessary overhead on my application... YES NO Is what I have done bad Not to mention stringWithContentsOfURL is deprecated in 3.0 And if so what is a better way to accomplish this iphone objective c ios cocoa touch reachability share improve.. viewWillDisappear where you receive a memory warning and the observer never gets unregistered so you should account for that as well. Note The domain you use doesn't matter. It's just testing for a..

How to programmatically send SMS on the iPhone?

http://stackoverflow.com/questions/10848/how-to-programmatically-send-sms-on-the-iphone

aware of it. You still cannot send fully automated SMS from the iPhone itself it requires some user interaction. But this at least allows you to populate everything and avoids closing the application... 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... SMS will allow any and all of these iOS devices to send SMS as long as they have internet access so it may still be a better solution for many applications. Alternately use both and only fall back to..

How to make a UITextField move up when keyboard is present

http://stackoverflow.com/questions/1126726/how-to-make-a-uitextfield-move-up-when-keyboard-is-present

standard way is to move up down the view having textfields whenever the keyboard is shown. Here is some sample code #define kOFFSET_FOR_KEYBOARD 80.0 void keyboardWillShow Animate the current view out of.. NO void textFieldDidBeginEditing UITextField sender if sender isEqual mailTf move the main view so that the keyboard does not hide it. if self.view.frame.origin.y 0 self setViewMovedUp YES method to.. you want to slide up the view CGRect rect self.view.frame if movedUp 1. move the view's origin up so that the text field that will be hidden come above the keyboard 2. increase the size of the view so..

iOS 6 apps - how to deal with iPhone 5 screen size? [duplicate]

http://stackoverflow.com/questions/12396545/ios-6-apps-how-to-deal-with-iphone-5-screen-size

5 screen size duplicate Possible Duplicate How to develop or migrate apps for iPhone 5 screen resolution I was just wondering with how should we deal with the iPhone 5 bigger screen size. As it has more.. when we got the Retina . And will we have to design two storyboards just like for the iPad I personally don't think Apple will require you to check the screen size every time you have to draw something.. personally don't think Apple will require you to check the screen size every time you have to draw something like many answers say. Does that happen with the iPad iphone ios iphone 5 share improve this..

How to detect iPhone 5 (widescreen devices)?

http://stackoverflow.com/questions/12446990/how-to-detect-iphone-5-widescreen-devices

application that runs on both iPhone 4 and 5 of course I have to build every window twice but I also have to detect whether the user has an iPhone with 3.5 or 4 screen and then apply the view. How should.. nor use different views for different screen sizes. Use the auto resizing capabilities of iOS so your views can adjust and adapt any screen size. That's not very hard read some documentation about.. capabilities of iOS so your views can adjust and adapt any screen size. That's not very hard read some documentation about that. It will save you a lot of time. iOS 6 also offers new features about this..

Programmatically get own phone number in iOS

http://stackoverflow.com/questions/193182/programmatically-get-own-phone-number-in-ios

this question At the risk of getting negative marks I want to suggest that the highest ranking solution currently the first response violates the latest SDK Agreement as of Nov 5 2009. Our application.. Our application was just rejected for using it. Here's the response from Apple For security reasons iPhone OS restricts an application including its preferences and data to a unique location in the.. is a set of fine grained controls limiting an application's access to files preferences network resources hardware and so on. The device's phone number is not available within your application's container...

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

do I associate file types with an iPhone application On the subject of associating your iPhone app with file.. do I associate file types with an iPhone application On the subject of associating your iPhone app with file types. In this informative question I learned that apps could be associated.. your 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..

Check iPhone iOS Version

http://stackoverflow.com/questions/3339722/check-iphone-ios-version

on the current device using NSClassFromString if NSClassFromString @ UIPopoverController Do something Some classes like CLLocationManager and UIDevice provide methods to check device capabilities.. and UIDevice provide methods to check device capabilities if CLLocationManager headingAvailable Do something Apple uses systemVersion in their GLSprite sample code so my recommendation can't be absolute.. headingAvailable Do something Apple uses systemVersion in their GLSprite sample code so my recommendation can't be absolute A system version of 3.1 or greater is required to use CADisplayLink...

How do I apply a perspective transform to a UIView?

http://stackoverflow.com/questions/347721/how-do-i-apply-a-perspective-transform-to-a-uiview

access one of the matrix cells of the CATransform3D m34 . Matrix math has never been my thing so I can't explain exactly why this works but it does. You'll need to set this value to a negative fraction.. for your initial transform then apply your layer rotation transforms to that. You should also be able to do the following UIView myView self subviews objectAtIndex 0 CALayer layer myView.layer CATransform3D.. the very bottom of the page implements this kind of perspective operation. The code should be reasonably simple to read. The sublayerTransform you refer to in your response is a transform that is applied..

Can I embed a custom font in an iPhone application?

http://stackoverflow.com/questions/360751/can-i-embed-a-custom-font-in-an-iphone-application

each glyph myself which is a bit too much like hard work especially for multi line text. I've also found posts that say straight out that it's not possible but without justification so I'm looking for.. text. I've also found posts that say straight out that it's not possible but without justification so I'm looking for a definitive answer. EDIT failed UIFont fontWithName size experiment I downloaded Harrowprint.tff.. size experiment I downloaded Harrowprint.tff downloaded from here and added it to my Resources directory and to the project. I then tried this code UIFont font UIFont fontWithName @ Harrowprint..

Fast and Lean PDF Viewer for iPhone / iPad / iOs - tips and hints?

http://stackoverflow.com/questions/3889634/fast-and-lean-pdf-viewer-for-iphone-ipad-ios-tips-and-hints

than a second before a crisp version appears. Im rendering 2 pages each side of the page in focus so that the PDF image is ready to mask the layer before it starts drawing.Pages are destroyed again when.. Recycle page objects by doing pointer swaps or destroy unused views Close any open Contexts as soon as you don't need them on receiving memory warnings release and reload the DocRef and any page Caches.. Text and here and Here and here positioning focused Searching and here doesn't work with all PDFs some just show weird characters I guess it's an encoding issue but I'm not sure Credit BrainFeeder CALayer..

Determine device (iPhone, iPod Touch) with iPhone SDK

http://stackoverflow.com/questions/448162/determine-device-iphone-ipod-touch-with-iphone-sdk

possible. iphone ios ipod touch share improve this question You can use the UIDevice class as so NSString deviceType UIDevice currentDevice .model if deviceType isEqualToString @ iPhone it's an iPhone..

How to detect iPhone 5 (widescreen devices)?

http://stackoverflow.com/questions/12446990/how-to-detect-iphone-5-widescreen-devices

to prevent precision errors when comparing floating points as pointed in the comments by H2CO3. So from now on you can use it in standard if else statements if IS_IPHONE_5 else Edit Better detection..

How to access SOAP services from iPhone

http://stackoverflow.com/questions/204465/how-to-access-soap-services-from-iphone

a bit of Googling lead to the conclusion that there is no support for SOAP in the iPhone SDK. So if I do want to build that app I'll need to come up with a approach to access SOAP services from the..

How to store custom objects in NSUserDefaults

http://stackoverflow.com/questions/2315948/how-to-store-custom-objects-in-nsuserdefaults

Now I've read up that apparently NSUserDefaults only stores some types of information. So how an I get my objects into NSUSerDefaults I read that there should be a way to to encode my custom.. decodeObjectForKey @ life return self void dealloc name release life release super dealloc @end So that's my class pretty straight forward I know it works in making my objects. So here is the relevant.. dealloc @end So that's my class pretty straight forward I know it works in making my objects. So here is the relevant parts of the AppDelegate file where I call the encryption and decrypt functions..

This class is not key value coding-compliant for the key

http://stackoverflow.com/questions/3088059/this-class-is-not-key-value-coding-compliant-for-the-key

the UILabel is linked with the File's Owner. the class of the File's Owner is SecondView . So what is wrong here One more thing every time I create a new application and try to link a UISomething.. . So what is wrong here One more thing every time I create a new application and try to link a UISomething to an IBOutlet I get the same error. Is there a global parameter that can generate the error..

How can I send mail from an iPhone application

http://stackoverflow.com/questions/310946/how-can-i-send-mail-from-an-iphone-application

body Wish 20you 20were 20here UIApplication sharedApplication openURL NSURL URLWithString url So how can I send an email from my app iphone cocoa touch email share improve this question On iOS..

How do you use NSAttributedString?

http://stackoverflow.com/questions/3482346/how-do-you-use-nsattributedstring

you use NSAttributedString Multiple colours in an NSString or NSMutableStrings are not possible. So I've heard a little about the NSAttributedString which was introduced with the iPad SDK 3.2 or around.. do it Edit Remember @ first @ second and @ third will be replaced by other strings at any time. So using hardcoded NSRange values won't work. iphone ipad ios4 nsattributedstring share improve this..

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

to do this. I'm looking for a simple portable re usable technique that can be done inside Xcode. Some history In 2008 we used to be able to make single static libs that included both sim and device. Apple.. ought to report this but they hide it # incidental searching for substrings in sh is a nightmare Sob SDK_VERSION echo SDK_NAME grep o '. 3 ' # Next work out if we're in SIM or DEVICE if PLATFORM_NAME.. is ALREADY being built Xcode WILL CRASH YOUR COMPUTER if you try this infinite recursion # # # So build ONLY the missing platforms configurations. if true ALREADYINVOKED false then echo RECURSION I..

Prefixing property names with an underscore in Objective C [duplicate]

http://stackoverflow.com/questions/3521254/prefixing-property-names-with-an-underscore-in-objective-c

names perhaps because its just not what was done back in my learning Java in college days. So when I define a property in Objective C this is what I naturally do. In the header @interface Whatever..

display image from URL retrieved from ALAsset in iPhone

http://stackoverflow.com/questions/3837115/display-image-from-url-retrieved-from-alasset-in-iphone

in iPhone I am using a ALAsset Framework for accessing the files in the device's photo gallery. So far I am able to access the thumbnail and display it. I want to display the actual image in an image.. of helps. Also when findLargeImage returns the resultblock wont have run yet as its a callback. So largeImage wont be valid yet. largeImage needs to be an instance variable not scoped to the method... devices so I couldnt rely on the image to be available directly after calling findLargeImage . So I changed it to call out to a delegate. @protocol HiresImageDelegate NSObject @optional void hiresImageAvailable..

How do you beta test an iphone app?

http://stackoverflow.com/questions/40154/how-do-you-beta-test-an-iphone-app

How to link to apps on the app store

http://stackoverflow.com/questions/433907/how-to-link-to-apps-on-the-app-store

to link to apps on the app store So I am creating a free version of my iPhone game. I want to have a button inside the free version that.. in the app store. If I use a standard link http itunes.apple.com WebObjects MZStore.woa wa viewSoftware id 300136119 mt 8 the iphone opens safari first and then the app store. I have used other apps..

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

with about ten different apps and the first one I look at has 43 instances of this scenario. So any clever ideas for a macro overridden class whatever to minimize the effort to change everything without..

UIDevice uniqueIdentifier Deprecated - What To Do Now?

http://stackoverflow.com/questions/6993325/uidevice-uniqueidentifier-deprecated-what-to-do-now

is created when the app starts for the first time is what Apple seems to want you to use . Edit 3 So this major point doesn't get lost in the comment noise do not use the MAC as UUID create a hash using.. a fixed value when querying the MAC to specifically thwart the MAC as base for an ID scheme. So you now really should use UIDevice identifierForVendor or create a per install UUID. share improve..

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

warning anymore iphone objective c ios automatic ref counting share improve this question Solution The compiler is warning about this for a reason. It's very rare that this warning should simply.. that the return value of the method it's calling is an object but does not retain release it. So you could end up creating a leak if your object is supposed to be released as in #3 above that is the.. where suppression of this warning would be necessary and good code design I'm coming up blank. Someone please share if they have had an experience where silencing this warning was necessary and the..

How to add a breakpoint to objc_exception_throw?

http://stackoverflow.com/questions/1163981/how-to-add-a-breakpoint-to-objc-exception-throw

to add a breakpoint to objc_exception_throw this was the answer from the brad larson on this SO question If you add two breakpoints you should be able to debug these exceptions. To do this go to Run..

Does UIGestureRecognizer work on a UIWebView?

http://stackoverflow.com/questions/2909807/does-uigesturerecognizer-work-on-a-uiwebview

messages. Depending on your usage you may need to do the same thing. There are other questions on SO on this topic. Here is the Event Handling documentation. In my case I added event listeners to document..

iPhone Landscape FAQ and Solutions

http://stackoverflow.com/questions/2953351/iphone-landscape-faq-and-solutions

Solutions There has been a lot of confusion and a set of corresponding set of questions here on SO how iPhone applications with proper handling for Landscape Portrait mode autorotation can be implemented...

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

the build architectures and remove armv7 from the plist of required device capabilities. See these SO questions and answers for more details deployment target vs base active sdk recommended way to support..

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

SDKs I created this community wiki to bind together a number of other Q A's I've seen here on SO. If you're here you've probably installed the final version of Xcode 3.2.3 with iPhone SDK 4 download..

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

done it simply will not work due to the Documented change in how Xcode processes targets Another SO questioner asked how to do it WITHOUT xcode and with responses that focussed on the arm6 vs arm7 part..

Is there a way to make drawRect work right NOW?

http://stackoverflow.com/questions/4739748/is-there-a-way-to-make-drawrect-work-right-now

pasted in below showing the console output you can see how it progressively slows. Here's the new SO question Mysterious progressive slowing problem in run loop drawRect. Here is V2 of the demo app..... be performed. For older OS versions you can break off a background thread manually or through an NSOperation. For manual background threading you can use NSThread detachNewThreadSelector @selector doWork.. progress bar. This sample application I created for my class illustrates how to use both NSOperations and queues for performing background work and then updating the UI when done. Also my Molecules..

CADisplayLink OpenGL rendering breaks UIScrollView behaviour

http://stackoverflow.com/questions/5944050/cadisplaylink-opengl-rendering-breaks-uiscrollview-behaviour

OpenGL rendering breaks UIScrollView behaviour There are a few similar questions out there on SO links at end but none of them has allowed me to fix my problem so here goes I'm using OpenGL rendering..

UIImage: Resize, then Crop

http://stackoverflow.com/questions/603907/uiimage-resize-then-crop

be upside down look like crap draw out of bounds or otherwise just not work correctly. Thank you SO much for your help. iphone ios image processing core graphics share improve this question I needed..

MKAnnotationView - Lock custom annotation view to pin on location updates

http://stackoverflow.com/questions/6392931/mkannotationview-lock-custom-annotation-view-to-pin-on-location-updates

this to happen without the user having to actually pinch to zoom. Original Post I along with other SO users are using this awesome solution to create a custom callout annotation http blog.asolutions.com..

Customize the MKAnnotationView callout

http://stackoverflow.com/questions/8018841/customize-the-mkannotationview-callout

is a big hack but also the cleanest way I've seen to implement custom annotations. Start with a NSObject Content class which has a coordinate the class of the callout view to use in the UML is AnnotationView.. class to initialize a MKAnnotation Annotation object. #import MapKit MapKit.h @interface Content NSObject @property nonatomic assign CLLocationCoordinate2D coordinate ... @interface Annotation NSObject.. NSObject @property nonatomic assign CLLocationCoordinate2D coordinate ... @interface Annotation NSObject MKAnnotation AnnotationProtocol id initWithContent Content content ... The Annotation implements..

Having trouble adding objects to NSMutableArray in Objective C

http://stackoverflow.com/questions/851926/having-trouble-adding-objects-to-nsmutablearray-in-objective-c

through the code at no point does CardIdObject appear in viewedCardsArray . Looking through SO I know these basic questions are pretty common to ObjC newbies like me so apologies in advance objective..

Dispelling the UIImage imageNamed: FUD

http://stackoverflow.com/questions/924740/dispelling-the-uiimage-imagenamed-fud

numbers of people saying the performance is good especially when rendering UITableView s. See this SO question for example or this article on iPhoneDeveloperTips.com UIImage 's imageNamed method used to..

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

it seems a bit unreliable because even Google could one day be down and relying on a 3rd party seems bad and while I could check to see for a response from some other websites if Google didn't respond it does seem wasteful and an unnecessary overhead on my application. BOOL connectedToInternet NSString URLString NSString.. URLWithString @ http www.google.com return URLString NULL YES NO Is what I have done bad Not to mention stringWithContentsOfURL is deprecated in 3.0 And if so what is a better way to accomplish this iphone objective c ios cocoa touch reachability share improve this question METHOD 1 Use a simple ARC and GCD compatible.. removeObserver self Note There might be an instance using viewWillDisappear where you receive a memory warning and the observer never gets unregistered so you should account for that as well. Note The domain you use doesn't matter. It's just testing for a gateway to any domain. Important Note The Reachability class..

How to programmatically send SMS on the iPhone?

http://stackoverflow.com/questions/10848/how-to-programmatically-send-sms-on-the-iphone

applications from sending automated SMS without the user explicitly aware of it. You still cannot send fully automated SMS from the iPhone itself it requires some user interaction. But this at least allows you to populate everything and avoids closing the application. The MFMessageComposeViewController class is well documented.. 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. If this is the case then Apple.. 3GS and 4 iPhones. However an intermediate server that sends SMS will allow any and all of these iOS devices to send SMS as long as they have internet access so it may still be a better solution for many applications. Alternately use both and only fall back to an online SMS service when the device doesn't support it. share..

How to make a UITextField move up when keyboard is present

http://stackoverflow.com/questions/1126726/how-to-make-a-uitextfield-move-up-when-keyboard-is-present

the textfields without being hidden by the keyboard the standard way is to move up down the view having textfields whenever the keyboard is shown. Here is some sample code #define kOFFSET_FOR_KEYBOARD 80.0 void keyboardWillShow Animate the current view out of the way if self.view.frame.origin.y 0 self setViewMovedUp.. YES else if self.view.frame.origin.y 0 self setViewMovedUp NO void textFieldDidBeginEditing UITextField sender if sender isEqual mailTf move the main view so that the keyboard does not hide it. if self.view.frame.origin.y 0 self setViewMovedUp YES method to move the view up down whenever the keyboard is shown dismissed.. nil context NULL UIView setAnimationDuration 0.3 if you want to slide up the view CGRect rect self.view.frame if movedUp 1. move the view's origin up so that the text field that will be hidden come above the keyboard 2. increase the size of the view so that the area behind the keyboard is covered up. rect.origin.y..

iOS 6 apps - how to deal with iPhone 5 screen size? [duplicate]

http://stackoverflow.com/questions/12396545/ios-6-apps-how-to-deal-with-iphone-5-screen-size

6 apps how to deal with iPhone 5 screen size duplicate Possible Duplicate How to develop or migrate apps for iPhone 5 screen resolution I was just wondering with how should we deal with the iPhone 5 bigger screen size. As it has more pixels in height things like GCRectMake that use coordinates.. problem won't work seamlessly between versions as it happened when we got the Retina . And will we have to design two storyboards just like for the iPad I personally don't think Apple will require you to check the screen size every time you have to draw something like many answers say. Does that happen with the iPad iphone.. we have to design two storyboards just like for the iPad I personally don't think Apple will require you to check the screen size every time you have to draw something like many answers say. Does that happen with the iPad iphone ios iphone 5 share improve this question All apps will continue to work in the vertically..

How to detect iPhone 5 (widescreen devices)?

http://stackoverflow.com/questions/12446990/how-to-detect-iphone-5-widescreen-devices

controller in the storyboard. Now if I want to create an application that runs on both iPhone 4 and 5 of course I have to build every window twice but I also have to detect whether the user has an iPhone with 3.5 or 4 screen and then apply the view. How should I do that iphone ios objective c screen device share improve.. of all you shouldn't rebuild all your views to fit a new screen nor use different views for different screen sizes. Use the auto resizing capabilities of iOS so your views can adjust and adapt any screen size. That's not very hard read some documentation about that. It will save you a lot of time. iOS 6 also offers new.. views for different screen sizes. Use the auto resizing capabilities of iOS so your views can adjust and adapt any screen size. That's not very hard read some documentation about that. It will save you a lot of time. iOS 6 also offers new features about this but this is still under NDA at the moment. Be sure to read..

Programmatically get own phone number in iOS

http://stackoverflow.com/questions/193182/programmatically-get-own-phone-number-in-ios

SDK iphone ios mobile phones phone number share improve this question At the risk of getting negative marks I want to suggest that the highest ranking solution currently the first response violates the latest SDK Agreement as of Nov 5 2009. Our application was just rejected for using it. Here's the response from.. response violates the latest SDK Agreement as of Nov 5 2009. Our application was just rejected for using it. Here's the response from Apple For security reasons iPhone OS restricts an application including its preferences and data to a unique location in the file system. This restriction is part of the security feature.. feature known as the application's sandbox. The sandbox is a set of fine grained controls limiting an application's access to files preferences network resources hardware and so on. The device's phone number is not available within your application's container. You will need to revise your application to read only within..

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

do I associate file types with an iPhone application On the subject of associating your iPhone app with file types. In this informative question I learned that apps could.. do I associate file types with an iPhone application On the subject of associating your 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.. types with an iPhone application On the subject of associating your 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..

Check iPhone iOS Version

http://stackoverflow.com/questions/3339722/check-iphone-ios-version

For example you can check if UIPopoverController is available on the current device using NSClassFromString if NSClassFromString @ UIPopoverController Do something Some classes like CLLocationManager and UIDevice provide methods to check device capabilities if CLLocationManager headingAvailable Do something Apple uses.. Do something Some classes like CLLocationManager and UIDevice provide methods to check device capabilities if CLLocationManager headingAvailable Do something Apple uses systemVersion in their GLSprite sample code so my recommendation can't be absolute A system version of 3.1 or greater is required to use CADisplayLink... provide methods to check device capabilities if CLLocationManager headingAvailable Do something Apple uses systemVersion in their GLSprite sample code so my recommendation can't be absolute A system version of 3.1 or greater is required to use CADisplayLink. The NSTimer class is used as fallback when it isn't available...

How do I apply a perspective transform to a UIView?

http://stackoverflow.com/questions/347721/how-do-i-apply-a-perspective-transform-to-a-uiview

to get perspective working as described here is to directly access one of the matrix cells of the CATransform3D m34 . Matrix math has never been my thing so I can't explain exactly why this works but it does. You'll need to set this value to a negative fraction for your initial transform then apply your layer rotation.. but it does. You'll need to set this value to a negative fraction for your initial transform then apply your layer rotation transforms to that. You should also be able to do the following UIView myView self subviews objectAtIndex 0 CALayer layer myView.layer CATransform3D rotationAndPerspectiveTransform CATransform3DIdentity.. example by Bill Dudney. The newest version of the program at the very bottom of the page implements this kind of perspective operation. The code should be reasonably simple to read. The sublayerTransform you refer to in your response is a transform that is applied to the sublayers of your UIView's CALayer . If you don't..

Can I embed a custom font in an iPhone application?

http://stackoverflow.com/questions/360751/can-i-embed-a-custom-font-in-an-iphone-application

showthread.php t 569311 but these would require me to render each glyph myself which is a bit too much like hard work especially for multi line text. I've also found posts that say straight out that it's not possible but without justification so I'm looking for a definitive answer. EDIT failed UIFont fontWithName size.. is a bit too much like hard work especially for multi line text. I've also found posts that say straight out that it's not possible but without justification so I'm looking for a definitive answer. EDIT failed UIFont fontWithName size experiment I downloaded Harrowprint.tff downloaded from here and added it to my Resources.. so I'm looking for a definitive answer. EDIT failed UIFont fontWithName size experiment I downloaded Harrowprint.tff downloaded from here and added it to my Resources directory and to the project. I then tried this code UIFont font UIFont fontWithName @ Harrowprint size 20 which resulted in an exception being thrown. Looking..

Fast and Lean PDF Viewer for iPhone / iPad / iOs - tips and hints?

http://stackoverflow.com/questions/3889634/fast-and-lean-pdf-viewer-for-iphone-ipad-ios-tips-and-hints

you can see a lower res version of the page for just less than a second before a crisp version appears. Im rendering 2 pages each side of the page in focus so that the PDF image is ready to mask the layer before it starts drawing.Pages are destroyed again when they are 2 pages away from the focused page. Does anyone have.. will be using memory beware of leaving contexts open though Recycle page objects by doing pointer swaps or destroy unused views Close any open Contexts as soon as you don't need them on receiving memory warnings release and reload the DocRef and any page Caches Other PDF Features Getting Links inside a PDF and here and.. a table of contents Document title and Keywords Getting Raw Text and here and Here and here positioning focused Searching and here doesn't work with all PDFs some just show weird characters I guess it's an encoding issue but I'm not sure Credit BrainFeeder CALayer and Off Screen Rendering render the next page for fast smooth..

Determine device (iPhone, iPod Touch) with iPhone SDK

http://stackoverflow.com/questions/448162/determine-device-iphone-ipod-touch-with-iphone-sdk

How to detect iPhone 5 (widescreen devices)?

http://stackoverflow.com/questions/12446990/how-to-detect-iphone-5-widescreen-devices

568 DBL_EPSILON The use of fabs with the epsilon is here to prevent precision errors when comparing floating points as pointed in the comments by H2CO3. So from now on you can use it in standard if else statements if IS_IPHONE_5 else Edit Better detection As stated by some people this does only detect a widescreen..

How to access SOAP services from iPhone

http://stackoverflow.com/questions/204465/how-to-access-soap-services-from-iphone

I was not able to find any support for accessing SOAP services a bit of Googling lead to the conclusion that there is no support for SOAP in the iPhone SDK. So if I do want to build that app I'll need to come up with a approach to access SOAP services from the iPhone. What would be the best approach Any best practices..

How to store custom objects in NSUserDefaults

http://stackoverflow.com/questions/2315948/how-to-store-custom-objects-in-nsuserdefaults

message I get when I put my custom class Player in the NSUserDefaults. Now I've read up that apparently NSUserDefaults only stores some types of information. So how an I get my objects into NSUSerDefaults I read that there should be a way to to encode my custom object and then put it in but I'm not sure how to implement.. self.name decoder decodeObjectForKey @ name self.life decoder decodeObjectForKey @ life return self void dealloc name release life release super dealloc @end So that's my class pretty straight forward I know it works in making my objects. So here is the relevant parts of the AppDelegate file where I call the encryption.. @ life return self void dealloc name release life release super dealloc @end So that's my class pretty straight forward I know it works in making my objects. So here is the relevant parts of the AppDelegate file where I call the encryption and decrypt functions @class MainViewController @interface MagicApp201AppDelegate..

This class is not key value coding-compliant for the key

http://stackoverflow.com/questions/3088059/this-class-is-not-key-value-coding-compliant-for-the-key

@implementation SecondView @synthesize string In my SecondView.xib the UILabel is linked with the File's Owner. the class of the File's Owner is SecondView . So what is wrong here One more thing every time I create a new application and try to link a UISomething to an IBOutlet I get the same error. Is there a global parameter.. the File's Owner. the class of the File's Owner is SecondView . So what is wrong here One more thing every time I create a new application and try to link a UISomething to an IBOutlet I get the same error. Is there a global parameter that can generate the error I've encountered Editor's note The project that used to be here..

How can I send mail from an iPhone application

http://stackoverflow.com/questions/310946/how-can-i-send-mail-from-an-iphone-application

cc bar@example.com subject Greetings 20from 20Cupertino body Wish 20you 20were 20here UIApplication sharedApplication openURL NSURL URLWithString url So how can I send an email from my app iphone cocoa touch email share improve this question On iOS 3.0 and later you should use the MFMailComposeViewController..

How do you use NSAttributedString?

http://stackoverflow.com/questions/3482346/how-do-you-use-nsattributedstring

do you use NSAttributedString Multiple colours in an NSString or NSMutableStrings are not possible. So I've heard a little about the NSAttributedString which was introduced with the iPad SDK 3.2 or around 3.2 and is available on the iPhone as of iPhone SDK 4.0 beta.. if not possible with NSAttributed string how would you do it Edit Remember @ first @ second and @ third will be replaced by other strings at any time. So using hardcoded NSRange values won't work. iphone ipad ios4 nsattributedstring share improve this question When building attributed strings I prefer to use..

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

I can find and Xcode's default templates are NOT configured to do this. I'm looking for a simple portable re usable technique that can be done inside Xcode. Some history In 2008 we used to be able to make single static libs that included both sim and device. Apple disabled that. Throughout 2009 we made pairs of static.. # First work out the BASESDK version number NB Apple ought to report this but they hide it # incidental searching for substrings in sh is a nightmare Sob SDK_VERSION echo SDK_NAME grep o '. 3 ' # Next work out if we're in SIM or DEVICE if PLATFORM_NAME iphonesimulator then OTHER_SDK_TO_BUILD iphoneos SDK_VERSION.. to build ALL targets # ...we MUST NOT re build the target that is ALREADY being built Xcode WILL CRASH YOUR COMPUTER if you try this infinite recursion # # # So build ONLY the missing platforms configurations. if true ALREADYINVOKED false then echo RECURSION I am NOT the root invocation so I'm NOT going to recurse else..

Prefixing property names with an underscore in Objective C [duplicate]

http://stackoverflow.com/questions/3521254/prefixing-property-names-with-an-underscore-in-objective-c

c class work I've always avoided underscores in my variable names perhaps because its just not what was done back in my learning Java in college days. So when I define a property in Objective C this is what I naturally do. In the header @interface Whatever NSString myStringProperty @property nonatomic copy NSString..

display image from URL retrieved from ALAsset in iPhone

http://stackoverflow.com/questions/3837115/display-image-from-url-retrieved-from-alasset-in-iphone

image from URL retrieved from ALAsset in iPhone I am using a ALAsset Framework for accessing the files in the device's photo gallery. So far I am able to access the thumbnail and display it. I want to display the actual image in an image view but I am unable to figure out how to do this. I tried.. think of them as notification selectors or callbacks it kind of helps. Also when findLargeImage returns the resultblock wont have run yet as its a callback. So largeImage wont be valid yet. largeImage needs to be an instance variable not scoped to the method. I use this construct to do this when using the method but you.. 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 . So I changed it to call out to a delegate. @protocol HiresImageDelegate NSObject @optional void hiresImageAvailable UIImage aimage @end and comme cá ALAssetsLibraryAssetForURLResultBlock..

How do you beta test an iphone app?

http://stackoverflow.com/questions/40154/how-do-you-beta-test-an-iphone-app

How to link to apps on the app store

http://stackoverflow.com/questions/433907/how-to-link-to-apps-on-the-app-store

to link to apps on the app store So I am creating a free version of my iPhone game. I want to have a button inside the free version that takes people to the paid version in the app store. If I use.. inside the free version that takes people to the paid version in the app store. If I use a standard link http itunes.apple.com WebObjects MZStore.woa wa viewSoftware id 300136119 mt 8 the iphone opens safari first and then the app store. I have used other apps that open the app store directly so I know it is possible...

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

loc loc release Not too bad in onsies twosies but I'm dealing with about ten different apps and the first one I look at has 43 instances of this scenario. So any clever ideas for a macro overridden class whatever to minimize the effort to change everything without making the code to obscure My first instinct is to override..

UIDevice uniqueIdentifier Deprecated - What To Do Now?

http://stackoverflow.com/questions/6993325/uidevice-uniqueidentifier-deprecated-what-to-do-now

to the old UIDevice uniqueIdentifier but a UUID that is created when the app starts for the first time is what Apple seems to want you to use . Edit 3 So this major point doesn't get lost in the comment noise do not use the MAC as UUID create a hash using the MAC . That hash will always create the same result every..

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

a leak And how can I change my code so that I don't get this warning anymore iphone objective c ios automatic ref counting share improve this question Solution The compiler is warning about this for a reason. It's very rare that this warning should simply be ignored and it's easy to work around. Here's how SEL selector.. ns_returns_autoreleased The call to methodForSelector assumes that the return value of the method it's calling is an object but does not retain release it. So you could end up creating a leak if your object is supposed to be released as in #3 above that is the method you're calling returns a new object . For selectors.. right now. Suppression In trying to think of a situation where suppression of this warning would be necessary and good code design I'm coming up blank. Someone please share if they have had an experience where silencing this warning was necessary and the above doesn't handle things properly . More It's possible to..

How to add a breakpoint to objc_exception_throw?

http://stackoverflow.com/questions/1163981/how-to-add-a-breakpoint-to-objc-exception-throw

to add a breakpoint to objc_exception_throw this was the answer from the brad larson on this SO question If you add two breakpoints you should be able to debug these exceptions. To do this go to Run Show Breakpoints and create two global breakpoints I do them..

Does UIGestureRecognizer work on a UIWebView?

http://stackoverflow.com/questions/2909807/does-uigesturerecognizer-work-on-a-uiwebview

PhoneGap code that they set up a queue and timer to send the messages. Depending on your usage you may need to do the same thing. There are other questions on SO on this topic. Here is the Event Handling documentation. In my case I added event listeners to document from body onload myloader function myloader document.addEventListener..

iPhone Landscape FAQ and Solutions

http://stackoverflow.com/questions/2953351/iphone-landscape-faq-and-solutions

Landscape FAQ and Solutions There has been a lot of confusion and a set of corresponding set of questions here on SO how iPhone applications with proper handling for Landscape Portrait mode autorotation can be implemented. It is especially difficult to implement such an application..

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

XCode 4.2 To support older devices you need to add armv6 to the build architectures and remove armv7 from the plist of required device capabilities. See these SO questions and answers for more details deployment target vs base active sdk recommended way to support backward compatibility How do you optionally use iPhone 3.0..

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

iPhone SDK 4 get &ldquo Base SDK missing&rdquo can't see other SDKs I created this community wiki to bind together a number of other Q A's I've seen here on SO. If you're here you've probably installed the final version of Xcode 3.2.3 with iPhone SDK 4 download link reg reqd and then encountered one or both of these problems..

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

them Apple's latest Xcode prevents you from doing what he's done it simply will not work due to the Documented change in how Xcode processes targets Another SO questioner asked how to do it WITHOUT xcode and with responses that focussed on the arm6 vs arm7 part but ignored the i386 part http stackoverflow.com questions..

Is there a way to make drawRect work right NOW?

http://stackoverflow.com/questions/4739748/is-there-a-way-to-make-drawrect-work-right-now

you will see clearly in the demo. Scroll to the 'answer' I pasted in below showing the console output you can see how it progressively slows. Here's the new SO question Mysterious progressive slowing problem in run loop drawRect. Here is V2 of the demo app... http www.fileswap.com dl p8lU3gAi stepwiseDrawingV2.zip.html.. to the main queue where ever you needed a UI update to be performed. For older OS versions you can break off a background thread manually or through an NSOperation. For manual background threading you can use NSThread detachNewThreadSelector @selector doWork toTarget self withObject nil or self performSelectorInBackground.. be needed to get constant UI updates while dealing with a continuous progress bar. This sample application I created for my class illustrates how to use both NSOperations and queues for performing background work and then updating the UI when done. Also my Molecules application uses background threads for processing new..

CADisplayLink OpenGL rendering breaks UIScrollView behaviour

http://stackoverflow.com/questions/5944050/cadisplaylink-opengl-rendering-breaks-uiscrollview-behaviour

OpenGL rendering breaks UIScrollView behaviour There are a few similar questions out there on SO links at end but none of them has allowed me to fix my problem so here goes I'm using OpenGL rendering to make an image tiling and caching library for use in a..

UIImage: Resize, then Crop

http://stackoverflow.com/questions/603907/uiimage-resize-then-crop

code example I have found so far seems to smash the image be upside down look like crap draw out of bounds or otherwise just not work correctly. Thank you SO much for your help. iphone ios image processing core graphics share improve this question I needed the same thing in my case to pick the dimension that fits..

MKAnnotationView - Lock custom annotation view to pin on location updates

http://stackoverflow.com/questions/6392931/mkannotationview-lock-custom-annotation-view-to-pin-on-location-updates

right over the pin. So now I need to figure out how to get this to happen without the user having to actually pinch to zoom. Original Post I along with other SO users are using this awesome solution to create a custom callout annotation http blog.asolutions.com 2010 09 building custom map annotation callouts part 1 When..

Customize the MKAnnotationView callout

http://stackoverflow.com/questions/8018841/customize-the-mkannotationview-callout

purposes here is some UML from a forked project This is a big hack but also the cleanest way I've seen to implement custom annotations. Start with a NSObject Content class which has a coordinate the class of the callout view to use in the UML is AnnotationView but you can create more and set them here and a dictionary.. of random values with the title photo url etc. Use this class to initialize a MKAnnotation Annotation object. #import MapKit MapKit.h @interface Content NSObject @property nonatomic assign CLLocationCoordinate2D coordinate ... @interface Annotation NSObject MKAnnotation AnnotationProtocol id initWithContent Content.. Annotation object. #import MapKit MapKit.h @interface Content NSObject @property nonatomic assign CLLocationCoordinate2D coordinate ... @interface Annotation NSObject MKAnnotation AnnotationProtocol id initWithContent Content content ... The Annotation implements AnnotationProtocol to announce it wants to handle the creation..

Having trouble adding objects to NSMutableArray in Objective C

http://stackoverflow.com/questions/851926/having-trouble-adding-objects-to-nsmutablearray-in-objective-c

according to the Leaks performance tool . However when stepping through the code at no point does CardIdObject appear in viewedCardsArray . Looking through SO I know these basic questions are pretty common to ObjC newbies like me so apologies in advance objective c iphone cocoa cocoa touch share improve this question..

Dispelling the UIImage imageNamed: FUD

http://stackoverflow.com/questions/924740/dispelling-the-uiimage-imagenamed-fud

I see a lot of people saying imageNamed is bad but equal numbers of people saying the performance is good especially when rendering UITableView s. See this SO question for example or this article on iPhoneDeveloperTips.com UIImage 's imageNamed method used to leak so it was best avoided but has been fixed in recent releases...

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

Google could one day be down and relying on a 3rd party seems bad and while I could check to see for a response from some other websites if Google didn't respond it does seem wasteful and an unnecessary overhead on my application. BOOL connectedToInternet.. URLString NULL YES NO Is what I have done bad Not to mention stringWithContentsOfURL is deprecated in 3.0 And if so what is a better way to accomplish this iphone objective c ios cocoa touch reachability share improve this question .. be an instance using viewWillDisappear where you receive a memory warning and the observer never gets unregistered so you should account for that as well. Note The domain you use doesn't matter. It's just testing for a gateway to any domain...

How to programmatically send SMS on the iPhone?

http://stackoverflow.com/questions/10848/how-to-programmatically-send-sms-on-the-iphone

without the user explicitly aware of it. You still cannot send fully automated SMS from the iPhone itself it requires some user interaction. But this at least allows you to populate everything and avoids closing the application. The MFMessageComposeViewController.. 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... server that sends SMS will allow any and all of these iOS devices to send SMS as long as they have internet access so it may still be a better solution for many applications. Alternately use both and only fall back to an online SMS service..

How to make a UITextField move up when keyboard is present

http://stackoverflow.com/questions/1126726/how-to-make-a-uitextfield-move-up-when-keyboard-is-present

by the keyboard the standard way is to move up down the view having textfields whenever the keyboard is shown. Here is some sample code #define kOFFSET_FOR_KEYBOARD 80.0 void keyboardWillShow Animate the current view out of the way if self.view.frame.origin.y.. self setViewMovedUp NO void textFieldDidBeginEditing UITextField sender if sender isEqual mailTf move the main view so that the keyboard does not hide it. if self.view.frame.origin.y 0 self setViewMovedUp YES method to move the view up down.. 0.3 if you want to slide up the view CGRect rect self.view.frame if movedUp 1. move the view's origin up so that the text field that will be hidden come above the keyboard 2. increase the size of the view so that the area behind..

iOS 6 apps - how to deal with iPhone 5 screen size? [duplicate]

http://stackoverflow.com/questions/12396545/ios-6-apps-how-to-deal-with-iphone-5-screen-size

to deal with iPhone 5 screen size duplicate Possible Duplicate How to develop or migrate apps for iPhone 5 screen resolution I was just wondering with how should we deal with the iPhone 5 bigger screen size. As it has more pixels in height.. as it happened when we got the Retina . And will we have to design two storyboards just like for the iPad I personally don't think Apple will require you to check the screen size every time you have to draw something like many answers.. like for the iPad I personally don't think Apple will require you to check the screen size every time you have to draw something like many answers say. Does that happen with the iPad iphone ios iphone 5 share improve this question All apps..

How to detect iPhone 5 (widescreen devices)?

http://stackoverflow.com/questions/12446990/how-to-detect-iphone-5-widescreen-devices

I want to create an application that runs on both iPhone 4 and 5 of course I have to build every window twice but I also have to detect whether the user has an iPhone with 3.5 or 4 screen and then apply the view. How should I do that iphone.. to fit a new screen nor use different views for different screen sizes. Use the auto resizing capabilities of iOS so your views can adjust and adapt any screen size. That's not very hard read some documentation about that. It will save you.. the auto resizing capabilities of iOS so your views can adjust and adapt any screen size. That's not very hard read some documentation about that. It will save you a lot of time. iOS 6 also offers new features about this but this is still..

Programmatically get own phone number in iOS

http://stackoverflow.com/questions/193182/programmatically-get-own-phone-number-in-ios

share improve this question At the risk of getting negative marks I want to suggest that the highest ranking solution currently the first response violates the latest SDK Agreement as of Nov 5 2009. Our application was just rejected.. as of Nov 5 2009. Our application was just rejected for using it. Here's the response from Apple For security reasons iPhone OS restricts an application including its preferences and data to a unique location in the file system. This restriction.. sandbox. The sandbox is a set of fine grained controls limiting an application's access to files preferences network resources hardware and so on. The device's phone number is not available within your application's container. You will need to..

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

do I associate file types with an iPhone application On the subject of associating your iPhone app with file types. In this informative.. do I associate file types with an iPhone application On the subject of associating your iPhone app with file types. In this informative question I learned that apps could be associated with custom.. subject of associating your 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..

Check iPhone iOS Version

http://stackoverflow.com/questions/3339722/check-iphone-ios-version

is available on the current device using NSClassFromString if NSClassFromString @ UIPopoverController Do something Some classes like CLLocationManager and UIDevice provide methods to check device capabilities if CLLocationManager.. CLLocationManager and UIDevice provide methods to check device capabilities if CLLocationManager headingAvailable Do something Apple uses systemVersion in their GLSprite sample code so my recommendation can't be absolute A system version of.. capabilities if CLLocationManager headingAvailable Do something Apple uses systemVersion in their GLSprite sample code so my recommendation can't be absolute A system version of 3.1 or greater is required to use CADisplayLink. The NSTimer class..

How do I apply a perspective transform to a UIView?

http://stackoverflow.com/questions/347721/how-do-i-apply-a-perspective-transform-to-a-uiview

here is to directly access one of the matrix cells of the CATransform3D m34 . Matrix math has never been my thing so I can't explain exactly why this works but it does. You'll need to set this value to a negative fraction for your initial.. to a negative fraction for your initial transform then apply your layer rotation transforms to that. You should also be able to do the following UIView myView self subviews objectAtIndex 0 CALayer layer myView.layer CATransform3D rotationAndPerspectiveTransform.. of the program at the very bottom of the page implements this kind of perspective operation. The code should be reasonably simple to read. The sublayerTransform you refer to in your response is a transform that is applied to the sublayers..

Can I embed a custom font in an iPhone application?

http://stackoverflow.com/questions/360751/can-i-embed-a-custom-font-in-an-iphone-application

require me to render each glyph myself which is a bit too much like hard work especially for multi line text. I've also found posts that say straight out that it's not possible but without justification so I'm looking for a definitive answer... for multi line text. I've also found posts that say straight out that it's not possible but without justification so I'm looking for a definitive answer. EDIT failed UIFont fontWithName size experiment I downloaded Harrowprint.tff downloaded.. EDIT failed UIFont fontWithName size experiment I downloaded Harrowprint.tff downloaded from here and added it to my Resources directory and to the project. I then tried this code UIFont font UIFont fontWithName @ Harrowprint size 20 which resulted..

Fast and Lean PDF Viewer for iPhone / iPad / iOs - tips and hints?

http://stackoverflow.com/questions/3889634/fast-and-lean-pdf-viewer-for-iphone-ipad-ios-tips-and-hints

page for just less than a second before a crisp version appears. Im rendering 2 pages each side of the page in focus so that the PDF image is ready to mask the layer before it starts drawing.Pages are destroyed again when they are 2 pages away.. contexts open though Recycle page objects by doing pointer swaps or destroy unused views Close any open Contexts as soon as you don't need them on receiving memory warnings release and reload the DocRef and any page Caches Other PDF Features.. Keywords Getting Raw Text and here and Here and here positioning focused Searching and here doesn't work with all PDFs some just show weird characters I guess it's an encoding issue but I'm not sure Credit BrainFeeder CALayer and Off Screen Rendering..

Determine device (iPhone, iPod Touch) with iPhone SDK

http://stackoverflow.com/questions/448162/determine-device-iphone-ipod-touch-with-iphone-sdk

and iPod Touch if possible. iphone ios ipod touch share improve this question You can use the UIDevice class as so NSString deviceType UIDevice currentDevice .model if deviceType isEqualToString @ iPhone it's an iPhone share improve..

How to detect iPhone 5 (widescreen devices)?

http://stackoverflow.com/questions/12446990/how-to-detect-iphone-5-widescreen-devices

the epsilon is here to prevent precision errors when comparing floating points as pointed in the comments by H2CO3. So from now on you can use it in standard if else statements if IS_IPHONE_5 else Edit Better detection As stated by some people..

How to access SOAP services from iPhone

http://stackoverflow.com/questions/204465/how-to-access-soap-services-from-iphone

accessing SOAP services a bit of Googling lead to the conclusion that there is no support for SOAP in the iPhone SDK. So if I do want to build that app I'll need to come up with a approach to access SOAP services from the iPhone. What would..

How to store custom objects in NSUserDefaults

http://stackoverflow.com/questions/2315948/how-to-store-custom-objects-in-nsuserdefaults

Player in the NSUserDefaults. Now I've read up that apparently NSUserDefaults only stores some types of information. So how an I get my objects into NSUSerDefaults I read that there should be a way to to encode my custom object and then put.. name self.life decoder decodeObjectForKey @ life return self void dealloc name release life release super dealloc @end So that's my class pretty straight forward I know it works in making my objects. So here is the relevant parts of the AppDelegate.. life release super dealloc @end So that's my class pretty straight forward I know it works in making my objects. So here is the relevant parts of the AppDelegate file where I call the encryption and decrypt functions @class MainViewController..

This class is not key value coding-compliant for the key

http://stackoverflow.com/questions/3088059/this-class-is-not-key-value-coding-compliant-for-the-key

string In my SecondView.xib the UILabel is linked with the File's Owner. the class of the File's Owner is SecondView . So what is wrong here One more thing every time I create a new application and try to link a UISomething to an IBOutlet I get.. Owner is SecondView . So what is wrong here One more thing every time I create a new application and try to link a UISomething to an IBOutlet I get the same error. Is there a global parameter that can generate the error I've encountered Editor's..

How can I send mail from an iPhone application

http://stackoverflow.com/questions/310946/how-can-i-send-mail-from-an-iphone-application

20from 20Cupertino body Wish 20you 20were 20here UIApplication sharedApplication openURL NSURL URLWithString url So how can I send an email from my app iphone cocoa touch email share improve this question On iOS 3.0 and later you should..

How do you use NSAttributedString?

http://stackoverflow.com/questions/3482346/how-do-you-use-nsattributedstring

do you use NSAttributedString Multiple colours in an NSString or NSMutableStrings are not possible. So I've heard a little about the NSAttributedString which was introduced with the iPad SDK 3.2 or around 3.2 and is available.. string how would you do it Edit Remember @ first @ second and @ third will be replaced by other strings at any time. So using hardcoded NSRange values won't work. iphone ipad ios4 nsattributedstring share improve this question When building..

Build fat static library (device + simulator) using Xcode and SDK 4+

http://stackoverflow.com/questions/3520977/build-fat-static-library-device-simulator-using-xcode-and-sdk-4

are NOT configured to do this. I'm looking for a simple portable re usable technique that can be done inside Xcode. Some history In 2008 we used to be able to make single static libs that included both sim and device. Apple disabled that... number NB Apple ought to report this but they hide it # incidental searching for substrings in sh is a nightmare Sob SDK_VERSION echo SDK_NAME grep o '. 3 ' # Next work out if we're in SIM or DEVICE if PLATFORM_NAME iphonesimulator then.. build the target that is ALREADY being built Xcode WILL CRASH YOUR COMPUTER if you try this infinite recursion # # # So build ONLY the missing platforms configurations. if true ALREADYINVOKED false then echo RECURSION I am NOT the root invocation..

Prefixing property names with an underscore in Objective C [duplicate]

http://stackoverflow.com/questions/3521254/prefixing-property-names-with-an-underscore-in-objective-c

underscores in my variable names perhaps because its just not what was done back in my learning Java in college days. So when I define a property in Objective C this is what I naturally do. In the header @interface Whatever NSString myStringProperty..

display image from URL retrieved from ALAsset in iPhone

http://stackoverflow.com/questions/3837115/display-image-from-url-retrieved-from-alasset-in-iphone

from ALAsset in iPhone I am using a ALAsset Framework for accessing the files in the device's photo gallery. So far I am able to access the thumbnail and display it. I want to display the actual image in an image view but I am unable.. or callbacks it kind of helps. Also when findLargeImage returns the resultblock wont have run yet as its a callback. So largeImage wont be valid yet. largeImage needs to be an instance variable not scoped to the method. I use this construct.. iOS5 maybe single core devices so I couldnt rely on the image to be available directly after calling findLargeImage . So I changed it to call out to a delegate. @protocol HiresImageDelegate NSObject @optional void hiresImageAvailable UIImage..

How do you beta test an iphone app?

http://stackoverflow.com/questions/40154/how-do-you-beta-test-an-iphone-app

How to link to apps on the app store

http://stackoverflow.com/questions/433907/how-to-link-to-apps-on-the-app-store

to link to apps on the app store So I am creating a free version of my iPhone game. I want to have a button inside the free version that takes people to the.. to the paid version in the app store. If I use a standard link http itunes.apple.com WebObjects MZStore.woa wa viewSoftware id 300136119 mt 8 the iphone opens safari first and then the app store. I have used other apps that open the app store..

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

twosies but I'm dealing with about ten different apps and the first one I look at has 43 instances of this scenario. So any clever ideas for a macro overridden class whatever to minimize the effort to change everything without making the code..

UIDevice uniqueIdentifier Deprecated - What To Do Now?

http://stackoverflow.com/questions/6993325/uidevice-uniqueidentifier-deprecated-what-to-do-now

but a UUID that is created when the app starts for the first time is what Apple seems to want you to use . Edit 3 So this major point doesn't get lost in the comment noise do not use the MAC as UUID create a hash using the MAC . That hash..

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

that I don't get this warning anymore iphone objective c ios automatic ref counting share improve this question Solution The compiler is warning about this for a reason. It's very rare that this warning should simply be ignored and it's.. assumes that the return value of the method it's calling is an object but does not retain release it. So you could end up creating a leak if your object is supposed to be released as in #3 above that is the method you're calling.. to think of a situation where suppression of this warning would be necessary and good code design I'm coming up blank. Someone please share if they have had an experience where silencing this warning was necessary and the above doesn't handle..

How to add a breakpoint to objc_exception_throw?

http://stackoverflow.com/questions/1163981/how-to-add-a-breakpoint-to-objc-exception-throw

to add a breakpoint to objc_exception_throw this was the answer from the brad larson on this SO question If you add two breakpoints you should be able to debug these exceptions. To do this go to Run Show Breakpoints..

Core-Data iPhone: could not locate an NSManagedObjectModel

http://stackoverflow.com/questions/1632497/core-data-iphone-could-not-locate-an-nsmanagedobjectmodel

now looks like this for the menu @class MenuViewController @interface CoreDataBooksAppDelegate NSObject UIApplicationDelegate NSManagedObjectModel managedObjectModel NSManagedObjectContext managedObjectContext NSPersistentStoreCoordinator.. NSLog @ After managedObjectContext @ managedObjectContext I found someone with a similar problem here on SO link text As Aryeh pointed out in that post In short you are trying to fetch an entity from an objectContext that hadn't..

Does UIGestureRecognizer work on a UIWebView?

http://stackoverflow.com/questions/2909807/does-uigesturerecognizer-work-on-a-uiwebview

timer to send the messages. Depending on your usage you may need to do the same thing. There are other questions on SO on this topic. Here is the Event Handling documentation. In my case I added event listeners to document from body onload..

iPhone Landscape FAQ and Solutions

http://stackoverflow.com/questions/2953351/iphone-landscape-faq-and-solutions

Landscape FAQ and Solutions There has been a lot of confusion and a set of corresponding set of questions here on SO how iPhone applications with proper handling for Landscape Portrait mode autorotation can be implemented. It is especially..

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 add armv6 to the build architectures and remove armv7 from the plist of required device capabilities. See these SO questions and answers for more details deployment target vs base active sdk recommended way to support backward compatibility..

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

can't see other SDKs I created this community wiki to bind together a number of other Q A's I've seen here on SO. If you're here you've probably installed the final version of Xcode 3.2.3 with iPhone SDK 4 download link reg reqd and..

Accessing iPhone WiFi Information via SDK

http://stackoverflow.com/questions/351954/accessing-iphone-wifi-information-via-sdk

in Wifi info not cellular. iphone cocoa touch wifi share improve this question Based on this bug report and this SO question I'm guessing there's no supported way to do this atm. EDIT Chris mentioned WiFinder which prompted me to do a little.. author's blog he used methods from the private Apple80211.framework. The framework mentioned in the above linked SO question. Apparently Apple will no longer allow these private API calls in apps which is preventing him from updating WiFinder...

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

from doing what he's done it simply will not work due to the Documented change in how Xcode processes targets Another SO questioner asked how to do it WITHOUT xcode and with responses that focussed on the arm6 vs arm7 part but ignored the i386..

Most effective way to do networking on Mac/iPhone?

http://stackoverflow.com/questions/4269613/most-effective-way-to-do-networking-on-mac-iphone

devices. an Apple provided Objective C wrapper ... AsyncSockets written originally by the mysterious Dustin J. Voss is SO GOOD that Apple just won't bother trying to write one AsyncSockets is exactly what you're after. It is used everywhere in..

Is there a way to make drawRect work right NOW?

http://stackoverflow.com/questions/4739748/is-there-a-way-to-make-drawrect-work-right-now

to the 'answer' I pasted in below showing the console output you can see how it progressively slows. Here's the new SO question Mysterious progressive slowing problem in run loop drawRect. Here is V2 of the demo app... http www.fileswap.com.. a UI update to be performed. For older OS versions you can break off a background thread manually or through an NSOperation. For manual background threading you can use NSThread detachNewThreadSelector @selector doWork toTarget self withObject.. dealing with a continuous progress bar. This sample application I created for my class illustrates how to use both NSOperations and queues for performing background work and then updating the UI when done. Also my Molecules application uses..

Learning iPhone SDK (Objective-C) [closed]

http://stackoverflow.com/questions/5656626/learning-iphone-sdk-objective-c

C. My school only offers Java courses which I'm not fond of and I really want to take a class or get a tutor. ANYTHING SO I CAN LEARN THIS LANGUAGE. I've got great app ideas but can't lay 'em out on paper. I currently am attending school and..

CADisplayLink OpenGL rendering breaks UIScrollView behaviour

http://stackoverflow.com/questions/5944050/cadisplaylink-opengl-rendering-breaks-uiscrollview-behaviour

OpenGL rendering breaks UIScrollView behaviour There are a few similar questions out there on SO links at end but none of them has allowed me to fix my problem so here goes I'm using OpenGL rendering to make an image..

UIImage: Resize, then Crop

http://stackoverflow.com/questions/603907/uiimage-resize-then-crop

to smash the image be upside down look like crap draw out of bounds or otherwise just not work correctly. Thank you SO much for your help. iphone ios image processing core graphics share improve this question I needed the same thing in..

MKAnnotationView - Lock custom annotation view to pin on location updates

http://stackoverflow.com/questions/6392931/mkannotationview-lock-custom-annotation-view-to-pin-on-location-updates

out how to get this to happen without the user having to actually pinch to zoom. Original Post I along with other SO users are using this awesome solution to create a custom callout annotation http blog.asolutions.com 2010 09 building custom..

Customize the MKAnnotationView callout

http://stackoverflow.com/questions/8018841/customize-the-mkannotationview-callout

a forked project This is a big hack but also the cleanest way I've seen to implement custom annotations. Start with a NSObject Content class which has a coordinate the class of the callout view to use in the UML is AnnotationView but you can.. url etc. Use this class to initialize a MKAnnotation Annotation object. #import MapKit MapKit.h @interface Content NSObject @property nonatomic assign CLLocationCoordinate2D coordinate ... @interface Annotation NSObject MKAnnotation AnnotationProtocol.. @interface Content NSObject @property nonatomic assign CLLocationCoordinate2D coordinate ... @interface Annotation NSObject MKAnnotation AnnotationProtocol id initWithContent Content content ... The Annotation implements AnnotationProtocol..

How to change a particular color in an image?

http://stackoverflow.com/questions/8046643/how-to-change-a-particular-color-in-an-image

have a Lion image just I want to change the color of the lion alone not the background color. For that I referred this SO question but it turns the color of whole image. Moreover the image is not looking great. I need the color change like photoshop...

Having trouble adding objects to NSMutableArray in Objective C

http://stackoverflow.com/questions/851926/having-trouble-adding-objects-to-nsmutablearray-in-objective-c

. However when stepping through the code at no point does CardIdObject appear in viewedCardsArray . Looking through SO I know these basic questions are pretty common to ObjC newbies like me so apologies in advance objective c iphone cocoa..

Is there any way to determine if the iphone is roaming?

http://stackoverflow.com/questions/900547/is-there-any-way-to-determine-if-the-iphone-is-roaming

using class dump . I was unable to find any references to 'roam' or 'roaming' 4. Obviously I started by checking at SO for this Couldn't find anything related. Further steps Does anyone have any advice here I know this is possible. Apple clearly..

Dispelling the UIImage imageNamed: FUD

http://stackoverflow.com/questions/924740/dispelling-the-uiimage-imagenamed-fud

is bad but equal numbers of people saying the performance is good especially when rendering UITableView s. See this SO question for example or this article on iPhoneDeveloperTips.com UIImage 's imageNamed method used to leak so it was best..