¡@

Home 

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

iphone Programming Glossary: some

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...

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 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..

How to detect iPhone 5 (widescreen devices)?

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

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.. 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 not an actual iPhone 5. Next versions of the iPod touch will..

How can I upload a photo to a server with the iPhone?

http://stackoverflow.com/questions/125306/how-can-i-upload-a-photo-to-a-server-with-the-iphone

it to a server. How do I upload a photo to a server with Cocoa in Xcode I suppose I use NSUrl somewhere. Thanks iphone cocoa touch cocoa networking share improve this question Header @interface.. alloc initWithURL NSURL URLWithString @ http yourserver.com uploadDB.php filePath @ path to some file delegate self doneSelector @selector onUploadDone errorSelector @selector onUploadError..

How do I detect when someone shakes an iPhone?

http://stackoverflow.com/questions/150446/how-do-i-detect-when-someone-shakes-an-iphone

do I detect when someone shakes an iPhone I want to react when somebody shakes the iPhone. I don't particularly care how.. do I detect when someone shakes an iPhone I want to react when somebody shakes the iPhone. I don't particularly care how they shake it just that it was waved vigorously.. there's now an easier way hook into the new motion events. The main trick is that you need to have some UIView not UIViewController that you want as firstResponder to receive the shake event messages. Here's..

Cropping a UIImage

http://stackoverflow.com/questions/158914/cropping-a-uiimage

a UIImage I've got some code that resizes an image so I can get a scaled chunk of the center of the image I use this to take.. could use a UIImageView and adjust the crop mode to achieve the same results but these images are sometimes displayed in UIWebViews . I've started to notice some crashes in this code and I'm a bit stumped... the same results but these images are sometimes displayed in UIWebViews . I've started to notice some crashes in this code and I'm a bit stumped. I've got two different theories and I'm wondering if either..

How to access SOAP services from iPhone

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

an app for the iPhone and that app would have to access a couple of SOAP services. While doing some basic checking in the iPhone SDK I was not able to find any support for accessing SOAP services a bit.. to access SOAP services from the iPhone. What would 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.. at all costs. Is it possible to add a proxy server between the iPhone and the web service Perhaps something that converts REST into SOAP for you You could try CSOAP a SOAP library that depends on libxml2..

EXC_BAD_ACCESS signal received

http://stackoverflow.com/questions/327082/exc-bad-access-signal-received

this question From your description I suspect the most likely explanation is that you have some error in your memory management. You said you've been working on iPhone development for a few weeks.. or a copy method you own the memory too and must release it when you are done. But if you get something back from just about anything else including factory methods e.g. NSString stringWithFormat then.. stringWithFormat then you'll have an autorelease reference which means it could be released at some time in the future by other code so it is vital that if you need to keep it around beyond the immediate..

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

approach but it doesn't work http www.drobnik.com touch 2010 04 universal static libraries There's some bugs in his script that means it only works on his machine he should be using BUILT_PRODUCTS_DIR and.. a new Target in Xcode of type bundle In your MAIN PROJECT in Build Phases add the new bundle as something it depends on top section hit the plus button scroll to bottom find the .bundle file in your Products..

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

git github.com zynga FontLabel.git The important files are FontLabel.h and FontLabel.m. It uses some of the code from Genericrich's answer above. Browse the source here http github.com zynga FontLabel..

How do I export UIImage array as a movie?

http://stackoverflow.com/questions/3741323/how-do-i-export-uiimage-array-as-a-movie

I now want to do is create movie from those images. But I don't have any idea how to do so. I hope someone can help me or send me a code snippet which does something like I want. Thx iphone export uiimage.. don't have any idea how to do so. I hope someone can help me or send me a code snippet which does something like I want. Thx iphone export uiimage avfoundation share improve this question Take a look.. NSError error nil AVAssetWriter videoWriter AVAssetWriter alloc initWithURL NSURL fileURLWithPath somePath fileType AVFileTypeQuickTimeMovie error error NSParameterAssert videoWriter NSDictionary videoSettings..

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

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..

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

Local notifications can be scheduled every n minutes but it's not possible to execute some code to get the current location without the user having to launch the app via the notification . This.. beginBackgroundTaskWithExpirationHandler As far as I understand this should be used to finish some work in the background also limited in time when an app is moved to the background rather than implementing.. 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 on my phone. share improve this..

NSCalendar first day of week

http://stackoverflow.com/questions/1106943/nscalendar-first-day-of-week

Edit This does not check the edge case where the beginning of the week starts in the prior month. Some updated code to cover this http stackoverflow.com a 14688780 308315 In case anyone is still paying attention..

gcc-4.2 failed with exit code 1 iphone

http://stackoverflow.com/questions/1248520/gcc-4-2-failed-with-exit-code-1-iphone

Platforms iPhoneSimulator.platform Developer usr bin gcc 4.2 failed with exit code 1 iphone Some discussions talk about libraries but because I don't have a programming background I don't understand..

Get to UIViewController from UIView on iPhone?

http://stackoverflow.com/questions/1340434/get-to-uiviewcontroller-from-uiview-on-iphone

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 the view controller directly. The view should..

Reading ePub format

http://stackoverflow.com/questions/1388467/reading-epub-format

the EPUB to unzip it somewhere to parse the manifest and then to display the relevant content. Some pointers if you're just starting out parse xml unzip To display content just use a UIWebView for now...

iPhone - UILabel containing text with multiple fonts at the same time

http://stackoverflow.com/questions/1417346/iphone-uilabel-containing-text-with-multiple-fonts-at-the-same-time

I am looking for a way to use a UILabel or something similar to display something like this Tom Some message. It is like how it's done in for example the Facebook app to display the what's on your mind..

How to add a UIImage in MailComposer Sheet of MFMailComposeViewController

http://stackoverflow.com/questions/1527351/how-to-add-a-uiimage-in-mailcomposer-sheet-of-mfmailcomposeviewcontroller

initWithString @ html body retain Add some text to it however you want emailBody appendString @ p Some email body text can go here p Pick an image to insert This example would come from the main bundle but..

iPhone ivar naming convention [duplicate]

http://stackoverflow.com/questions/2114587/iphone-ivar-naming-convention

missing Thanks iphone objective c share improve this question There is not consensus on this. Some people like to use it for clarity to separate out class variables and as another responder noted to.. the use is mixed. However I greatly prefer to not use the _ prefix and have two strong reasons 1 Some people think the _ is a good indicator of private . My take is that NO class local variable should be..

Compression API on the iPhone

http://stackoverflow.com/questions/230984/compression-api-on-the-iphone

efficiency. I don't care what the format ZIP LHA whatever is and it does not need to be secure. Some respondents have pointed out that the server can compress its output and the iPhone can consume that...

Check iPhone iOS Version

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

the current device using NSClassFromString if NSClassFromString @ UIPopoverController Do something Some classes like CLLocationManager and UIDevice provide methods to check device capabilities if CLLocationManager..

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..

UITextView with Syntax Highlighting [duplicate]

http://stackoverflow.com/questions/3642540/uitextview-with-syntax-highlighting

in a UITextView specifically syntax highlighting and detection for Objective C on the iPhone . Some of my Ideas of how to do this NSAttributedString . Now available in iOS 3.2 and greater. But how would.. text selection highlight background colors text storage management efficiency spell checking etc. Some of these are provided by system frameworks but still need a lot of integration. File a bug and wait..

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

improve the performance memory handling of Drawing PDF's or any other issues discussed here EDIT Some Tips Credit Luke Mcneice VdesmedT Matt Gallagher Johann Save any media to disk when you can. Use larger..

How to change UIPickerView height

http://stackoverflow.com/questions/573979/how-to-change-uipickerview-height

to change UIPickerView height Is it possible to change the height of UIPickerView Some applications seem to have shorter PickerViews but setting a smaller frame doesn't seem to work and the..

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

is downloading a set of image 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..

Learning OpenGL ES 1.x

http://stackoverflow.com/questions/72288/learning-opengl-es-1-x

answers about learning general OpenGL see http stackoverflow.com questions 62540 learning opengl Some resources I've found http khronos.org opengles 1_X http www.imgtec.com powervr insider sdk KhronosOpenGLES1xMBX.asp..

Has anyone implemented the PayPal API through a native iPhone app?

http://stackoverflow.com/questions/779423/has-anyone-implemented-the-paypal-api-through-a-native-iphone-app

AMT .2f CURRENCYCODE USD DESC @ RETURNURL @ userName password signature self.donationAmount @ Some Charge returnCallURL NSLog parameterString NSURL url NSURL URLWithString paypalUrlNVP NSMutableURLRequest..

URL encode an NSString

http://stackoverflow.com/questions/8088473/url-encode-an-nsstring

NULL CFStringRef unencodedString NULL CFStringRef @ ' @ # kCFStringEncodingUTF8 Some good reading about the subject Objective c iPhone percent encode a string Objective C url encoding http..

Are there any good UIScrollView Tutorials on the net?

http://stackoverflow.com/questions/820557/are-there-any-good-uiscrollview-tutorials-on-the-net

This goes to community wiki. iphone uikit uiscrollview share improve this question Some good samples with the basic functionalities covered very simple uiscrollview demo Scrolling UiScrollViewTutorial..

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..

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..

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..

How to detect iPhone 5 (widescreen devices)?

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

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 the.. 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 not an actual iPhone 5. Next versions of the iPod touch will maybe also have such a screen so we may use another set of..

How can I upload a photo to a server with the iPhone?

http://stackoverflow.com/questions/125306/how-can-i-upload-a-photo-to-a-server-with-the-iphone

I'm writing an iPhone app that takes a photo and then uploads it to a server. How do I upload a photo to a server with Cocoa in Xcode I suppose I use NSUrl somewhere. Thanks iphone cocoa touch cocoa networking share improve this question Header @interface EPUploader NSObject NSURL serverURL NSString filePath id delegate..

How do I detect when someone shakes an iPhone?

http://stackoverflow.com/questions/150446/how-do-i-detect-when-someone-shakes-an-iphone

do I detect when someone shakes an iPhone I want to react when somebody shakes the iPhone. I don't particularly care how they shake it just that it was waved vigorously about for a.. do I detect when someone shakes an iPhone I want to react when somebody shakes the iPhone. I don't particularly care how they shake it just that it was waved vigorously about for a split second. Does anyone know how to detect this.. motion detection share improve this question In 3.0 there's now an easier way hook into the new motion events. The main trick is that you need to have some UIView not UIViewController that you want as firstResponder to receive the shake event messages. Here's the code that you can use in any UIView to get shake events..

Cropping a UIImage

http://stackoverflow.com/questions/158914/cropping-a-uiimage

a UIImage I've got some code that resizes an image so I can get a scaled chunk of the center of the image I use this to take a UIImage and return a small square representation of an image.. to what's seen in the album view of the Photos app. I know I could use a UIImageView and adjust the crop mode to achieve the same results but these images are sometimes displayed in UIWebViews . I've started to notice some crashes in this code and I'm a bit stumped. I've got two different theories and I'm wondering if either.. I could use a UIImageView and adjust the crop mode to achieve the same results but these images are sometimes displayed in UIWebViews . I've started to notice some crashes in this code and I'm a bit stumped. I've got two different theories and I'm wondering if either is on base. Theory 1 I achieve the cropping by drawing into..

How to access SOAP services from iPhone

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

to access SOAP services from iPhone I'm planning to develop an app for the iPhone and that app would have to access a couple of SOAP services. While doing some basic checking in the iPhone SDK 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.. 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 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.. that isn't a real answer. But still SOAP should be avoided at all costs. Is it possible to add a proxy server between the iPhone and the web service Perhaps something that converts REST into SOAP for you You could try CSOAP a SOAP library that depends on libxml2 which is included in the iPhone SDK . I've written my own SOAP..

EXC_BAD_ACCESS signal received

http://stackoverflow.com/questions/327082/exc-bad-access-signal-received

with it iphone objective c ios xcode cocoa touch share improve this question From your description I suspect the most likely explanation is that you have some error in your memory management. You said you've been working on iPhone development for a few weeks but not whether you are experienced with Objective C in general... usually the static alloc method but there are a few others or a copy method you own the memory too and must release it when you are done. But if you get something back from just about anything else including factory methods e.g. NSString stringWithFormat then you'll have an autorelease reference which means it could.. about anything else including factory methods e.g. NSString stringWithFormat then you'll have an autorelease reference which means it could be released at some time in the future by other code so it is vital that if you need to keep it around beyond the immediate function that you retain it. If you don't the memory may..

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

that too. References This is a great idea it's an excellent approach but it doesn't work http www.drobnik.com touch 2010 04 universal static libraries There's some bugs in his script that means it only works on his machine he should be using BUILT_PRODUCTS_DIR and or BUILD_DIR instead of guesstimating them Apple's latest Xcode.. comes AFTER THE FIRST ONE copy paste the code below Create a new Target in Xcode of type bundle In your MAIN PROJECT in Build Phases add the new bundle as something it depends on top section hit the plus button scroll to bottom find the .bundle file in your Products In your NEW BUNDLE TARGET in Build Phases add a Copy..

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

How do I export UIImage array as a movie?

http://stackoverflow.com/questions/3741323/how-do-i-export-uiimage-array-as-a-movie

problem I have an array with several UIImage objects. What I now want to do is create movie from those images. But I don't have any idea how to do so. I hope someone can help me or send me a code snippet which does something like I want. Thx iphone export uiimage avfoundation share improve this question Take a look at.. I now want to do is create movie from those images. But I don't have any idea how to do so. I hope someone can help me or send me a code snippet which does something like I want. Thx iphone export uiimage avfoundation share improve this question Take a look at AVAssetWriter and the rest of the AVFoundation framework.. a video stream. Essentially you ™ll have to 1 Wire the writer NSError error nil AVAssetWriter videoWriter AVAssetWriter alloc initWithURL NSURL fileURLWithPath somePath fileType AVFileTypeQuickTimeMovie error error NSParameterAssert videoWriter NSDictionary videoSettings NSDictionary dictionaryWithObjectsAndKeys AVVideoCodecH264..

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

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..

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

but doesn't seem to be designed for background tasks Local notifications Local notifications can be scheduled every n minutes but it's not possible to execute some code to get the current location without the user having to launch the app via the notification . This approach also doesn't seem to be a clean approach as this.. this is not what notifications should be used for. UIApplication beginBackgroundTaskWithExpirationHandler As far as I understand this should be used to finish some work in the background also limited in time when an app is moved to the background rather than implementing long running background processes. How can I implement..

NSCalendar first day of week

http://stackoverflow.com/questions/1106943/nscalendar-first-day-of-week

calendar weekday nscalendar share improve this question Edit This does not check the edge case where the beginning of the week starts in the prior month. Some updated code to cover this http stackoverflow.com a 14688780 308315 In case anyone is still paying attention to this you need to use ordinalityOfUnit inUnit forDate..

gcc-4.2 failed with exit code 1 iphone

http://stackoverflow.com/questions/1248520/gcc-4-2-failed-with-exit-code-1-iphone

ROUND_SIZE 10 Now it shows that I have an error Command Developer Platforms iPhoneSimulator.platform Developer usr bin gcc 4.2 failed with exit code 1 iphone Some discussions talk about libraries but because I don't have a programming background I don't understand what to do. I also see that some people show a log output..

Get to UIViewController from UIView on iPhone?

http://stackoverflow.com/questions/1340434/get-to-uiviewcontroller-from-uiview-on-iphone

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 the view controller directly. The view should instead be independent of the view controller and be able..

Reading ePub format

http://stackoverflow.com/questions/1388467/reading-epub-format

difficult or complex. You'll need to work out how to download the EPUB to unzip it somewhere to parse the manifest and then to display the relevant content. Some pointers if you're just starting out parse xml unzip To display content just use a UIWebView for now. Here's a high level step by step for your code 1 create a..

iPhone - UILabel containing text with multiple fonts at the same time

http://stackoverflow.com/questions/1417346/iphone-uilabel-containing-text-with-multiple-fonts-at-the-same-time

UILabel containing text with multiple fonts at the same time I am looking for a way to use a UILabel or something similar to display something like this Tom Some message. It is like how it's done in for example the Facebook app to display the what's on your mind messages. Does anyone have any suggestions how to approach..

How to add a UIImage in MailComposer Sheet of MFMailComposeViewController

http://stackoverflow.com/questions/1527351/how-to-add-a-uiimage-in-mailcomposer-sheet-of-mfmailcomposeviewcontroller

email body NSMutableString emailBody NSMutableString alloc initWithString @ html body retain Add some text to it however you want emailBody appendString @ p Some email body text can go here p Pick an image to insert This example would come from the main bundle but your source can be elsewhere UIImage emailImage UIImage imageNamed..

iPhone ivar naming convention [duplicate]

http://stackoverflow.com/questions/2114587/iphone-ivar-naming-convention

@synthesize variable _variable Why is this done What am I missing Thanks iphone objective c share improve this question There is not consensus on this. Some people like to use it for clarity to separate out class variables and as another responder noted to avoid conflict with incoming parameter names. Even in Apple.. with incoming parameter names. Even in Apple sample code the use is mixed. However I greatly prefer to not use the _ prefix and have two strong reasons 1 Some people think the _ is a good indicator of private . My take is that NO class local variable should be accessed without a setter getter property and thus they are..

Compression API on the iPhone

http://stackoverflow.com/questions/230984/compression-api-on-the-iphone

but we want to compress at least some of the conversations for efficiency. I don't care what the format ZIP LHA whatever is and it does not need to be secure. Some respondents have pointed out that the server can compress its output and the iPhone can consume that. The scenario we have is exactly the reverse. We'll be POSTing..

Check iPhone iOS Version

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

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 systemVersion..

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 libs..

UITextView with Syntax Highlighting [duplicate]

http://stackoverflow.com/questions/3642540/uitextview-with-syntax-highlighting

Is there a Framework or Library that can do Syntax Highlighting in a UITextView specifically syntax highlighting and detection for Objective C on the iPhone . Some of my Ideas of how to do this NSAttributedString . Now available in iOS 3.2 and greater. But how would I put a NSAttributedString into a UITextView UIWebView ... and UITextInput . This includes but is not limited to text selection highlight background colors text storage management efficiency spell checking etc. Some of these are provided by system frameworks but still need a lot of integration. File a bug and wait for a nice public API to come my personal approach . Convince..

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

anyone have any insights no matter how small or obvious to improve the performance memory handling of Drawing PDF's or any other issues discussed here EDIT Some Tips Credit Luke Mcneice VdesmedT Matt Gallagher Johann Save any media to disk when you can. Use larger tileSizes if rendering on TiledLayers init frequently used..

How to change UIPickerView height

http://stackoverflow.com/questions/573979/how-to-change-uipickerview-height

to change UIPickerView height Is it possible to change the height of UIPickerView Some applications seem to have shorter PickerViews but setting a smaller frame doesn't seem to work and the frame is locked in Interface Builder. iphone cocoa touch..

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

optimize an image size with the iPhone SDK My application is downloading a set of image 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..

Learning OpenGL ES 1.x

http://stackoverflow.com/questions/72288/learning-opengl-es-1-x

1.x so I may miss out on some important concepts. Note For answers about learning general OpenGL see http stackoverflow.com questions 62540 learning opengl Some resources I've found http khronos.org opengles 1_X http www.imgtec.com powervr insider sdk KhronosOpenGLES1xMBX.asp OpenGL Distilled by Paul Martz a good refresher..

Has anyone implemented the PayPal API through a native iPhone app?

http://stackoverflow.com/questions/779423/has-anyone-implemented-the-paypal-api-through-a-native-iphone-app

@ USER @ PWD @ SIGNATURE @ VERSION 57.0 METHOD SetMobileCheckout AMT .2f CURRENCYCODE USD DESC @ RETURNURL @ userName password signature self.donationAmount @ Some Charge returnCallURL NSLog parameterString NSURL url NSURL URLWithString paypalUrlNVP NSMutableURLRequest theRequest NSMutableURLRequest requestWithURL url NSString..

URL encode an NSString

http://stackoverflow.com/questions/8088473/url-encode-an-nsstring

NSString encodedString NSString CFURLCreateStringByAddingPercentEscapes NULL CFStringRef unencodedString NULL CFStringRef @ ' @ # kCFStringEncodingUTF8 Some good reading about the subject Objective c iPhone percent encode a string Objective C url encoding http cybersam.com programming proper url percent encoding in..

Are there any good UIScrollView Tutorials on the net?

http://stackoverflow.com/questions/820557/are-there-any-good-uiscrollview-tutorials-on-the-net

Tutorials on the net Any good links are highly appreciated This goes to community wiki. iphone uikit uiscrollview share improve this question Some good samples with the basic functionalities covered very simple uiscrollview demo Scrolling UiScrollViewTutorial implementing tap to zoom in uiscrollview on an..

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..

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..

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..

How to detect iPhone 5 (widescreen devices)?

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

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.. 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 not an actual iPhone 5. Next versions of the iPod touch will maybe also have such..

How can I upload a photo to a server with the iPhone?

http://stackoverflow.com/questions/125306/how-can-i-upload-a-photo-to-a-server-with-the-iphone

a photo and then uploads it to a server. How do I upload a photo to a server with Cocoa in Xcode I suppose I use NSUrl somewhere. Thanks iphone cocoa touch cocoa networking share improve this question Header @interface EPUploader NSObject.. @end Usage EPUploader alloc initWithURL NSURL URLWithString @ http yourserver.com uploadDB.php filePath @ path to some file delegate self doneSelector @selector onUploadDone errorSelector @selector onUploadError share improve this..

How do I detect when someone shakes an iPhone?

http://stackoverflow.com/questions/150446/how-do-i-detect-when-someone-shakes-an-iphone

do I detect when someone shakes an iPhone I want to react when somebody shakes the iPhone. I don't particularly care how they shake it just that.. do I detect when someone shakes an iPhone I want to react when somebody shakes the iPhone. I don't particularly care how they shake it just that it was waved vigorously about for a split second... question In 3.0 there's now an easier way hook into the new motion events. The main trick is that you need to have some UIView not UIViewController that you want as firstResponder to receive the shake event messages. Here's the code that you..

Cropping a UIImage

http://stackoverflow.com/questions/158914/cropping-a-uiimage

a UIImage I've got some code that resizes an image so I can get a scaled chunk of the center of the image I use this to take a UIImage and return.. Photos app. I know I could use a UIImageView and adjust the crop mode to achieve the same results but these images are sometimes displayed in UIWebViews . I've started to notice some crashes in this code and I'm a bit stumped. I've got two different.. crop mode to achieve the same results but these images are sometimes displayed in UIWebViews . I've started to notice some crashes in this code and I'm a bit stumped. I've got two different theories and I'm wondering if either is on base. Theory..

How to access SOAP services from iPhone

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

I'm planning to develop an app for the iPhone and that app would have to access a couple of SOAP services. While doing some basic checking in the iPhone SDK I was not able to find any support for accessing SOAP services a bit of Googling lead to.. up with a approach to access SOAP services from the iPhone. What would 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.. should be avoided at all costs. Is it possible to add a proxy server between the iPhone and the web service Perhaps something that converts REST into SOAP for you You could try CSOAP a SOAP library that depends on libxml2 which is included in..

EXC_BAD_ACCESS signal received

http://stackoverflow.com/questions/327082/exc-bad-access-signal-received

touch share improve this question From your description I suspect the most likely explanation is that you have some error in your memory management. You said you've been working on iPhone development for a few weeks but not whether you.. there are a few others or a copy method you own the memory too and must release it when you are done. But if you get something back from just about anything else including factory methods e.g. NSString stringWithFormat then you'll have an autorelease.. methods e.g. NSString stringWithFormat then you'll have an autorelease reference which means it could be released at some time in the future by other code so it is vital that if you need to keep it around beyond the immediate function that you..

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

it's an excellent approach but it doesn't work http www.drobnik.com touch 2010 04 universal static libraries There's some bugs in his script that means it only works on his machine he should be using BUILT_PRODUCTS_DIR and or BUILD_DIR instead.. the code below Create a new Target in Xcode of type bundle In your MAIN PROJECT in Build Phases add the new bundle as something it depends on top section hit the plus button scroll to bottom find the .bundle file in your Products In your NEW BUNDLE..

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

put it on github here git github.com zynga FontLabel.git The important files are FontLabel.h and FontLabel.m. It uses some of the code from Genericrich's answer above. Browse the source here http github.com zynga FontLabel tree master share improve..

How do I export UIImage array as a movie?

http://stackoverflow.com/questions/3741323/how-do-i-export-uiimage-array-as-a-movie

objects. What I now want to do is create movie from those images. But I don't have any idea how to do so. I hope someone can help me or send me a code snippet which does something like I want. Thx iphone export uiimage avfoundation share.. those images. But I don't have any idea how to do so. I hope someone can help me or send me a code snippet which does something like I want. Thx iphone export uiimage avfoundation share improve this question Take a look at AVAssetWriter and.. to 1 Wire the writer NSError error nil AVAssetWriter videoWriter AVAssetWriter alloc initWithURL NSURL fileURLWithPath somePath fileType AVFileTypeQuickTimeMovie error error NSParameterAssert videoWriter NSDictionary videoSettings NSDictionary..

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

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..

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

tasks Local notifications Local notifications can be scheduled every n minutes but it's not possible to execute some code to get the current location without the user having to launch the app via the notification . This approach also doesn't.. used for. UIApplication beginBackgroundTaskWithExpirationHandler As far as I understand this should be used to finish some work in the background also limited in time when an app is moved to the background rather than implementing long running..

NSCalendar first day of week

http://stackoverflow.com/questions/1106943/nscalendar-first-day-of-week

this question Edit This does not check the edge case where the beginning of the week starts in the prior month. Some updated code to cover this http stackoverflow.com a 14688780 308315 In case anyone is still paying attention to this you..

gcc-4.2 failed with exit code 1 iphone

http://stackoverflow.com/questions/1248520/gcc-4-2-failed-with-exit-code-1-iphone

an error Command Developer Platforms iPhoneSimulator.platform Developer usr bin gcc 4.2 failed with exit code 1 iphone Some discussions talk about libraries but because I don't have a programming background I don't understand what to do. I also..

Get to UIViewController from UIView on iPhone?

http://stackoverflow.com/questions/1340434/get-to-uiviewcontroller-from-uiview-on-iphone

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 the view controller directly. The view should instead be independent..

Reading ePub format

http://stackoverflow.com/questions/1388467/reading-epub-format

out how to download the EPUB to unzip it somewhere to parse the manifest and then to display the relevant content. Some pointers if you're just starting out parse xml unzip To display content just use a UIWebView for now. Here's a high level..

iPhone - UILabel containing text with multiple fonts at the same time

http://stackoverflow.com/questions/1417346/iphone-uilabel-containing-text-with-multiple-fonts-at-the-same-time

at the same time I am looking for a way to use a UILabel or something similar to display something like this Tom Some message. It is like how it's done in for example the Facebook app to display the what's on your mind messages. Does anyone..

How to add a UIImage in MailComposer Sheet of MFMailComposeViewController

http://stackoverflow.com/questions/1527351/how-to-add-a-uiimage-in-mailcomposer-sheet-of-mfmailcomposeviewcontroller

alloc initWithString @ html body retain Add some text to it however you want emailBody appendString @ p Some email body text can go here p Pick an image to insert This example would come from the main bundle but your source can be..

iPhone ivar naming convention [duplicate]

http://stackoverflow.com/questions/2114587/iphone-ivar-naming-convention

this done What am I missing Thanks iphone objective c share improve this question There is not consensus on this. Some people like to use it for clarity to separate out class variables and as another responder noted to avoid conflict with.. in Apple sample code the use is mixed. However I greatly prefer to not use the _ prefix and have two strong reasons 1 Some people think the _ is a good indicator of private . My take is that NO class local variable should be accessed without a..

Compression API on the iPhone

http://stackoverflow.com/questions/230984/compression-api-on-the-iphone

the conversations for efficiency. I don't care what the format ZIP LHA whatever is and it does not need to be secure. Some respondents have pointed out that the server can compress its output and the iPhone can consume that. The scenario we have..

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 headingAvailable..

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

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

are NOT configured to do this. I'm looking for a simple portable re usable technique that can be done inside Xcode. Some history In 2008 we used to be able to make single static libs that included both sim and device. Apple disabled that. Throughout..

UITextView with Syntax Highlighting [duplicate]

http://stackoverflow.com/questions/3642540/uitextview-with-syntax-highlighting

do Syntax Highlighting in a UITextView specifically syntax highlighting and detection for Objective C on the iPhone . Some of my Ideas of how to do this NSAttributedString . Now available in iOS 3.2 and greater. But how would I put a NSAttributedString.. is not limited to text selection highlight background colors text storage management efficiency spell checking etc. Some of these are provided by system frameworks but still need a lot of integration. File a bug and wait for a nice public API..

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

small or obvious to improve the performance memory handling of Drawing PDF's or any other issues discussed here EDIT Some Tips Credit Luke Mcneice VdesmedT Matt Gallagher Johann Save any media to disk when you can. Use larger tileSizes if rendering..

How to change UIPickerView height

http://stackoverflow.com/questions/573979/how-to-change-uipickerview-height

to change UIPickerView height Is it possible to change the height of UIPickerView Some applications seem to have shorter PickerViews but setting a smaller frame doesn't seem to work and the frame is locked in..

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

SDK My application is downloading a set of image 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..

Learning OpenGL ES 1.x

http://stackoverflow.com/questions/72288/learning-opengl-es-1-x

concepts. Note For answers about learning general OpenGL see http stackoverflow.com questions 62540 learning opengl Some resources I've found http khronos.org opengles 1_X http www.imgtec.com powervr insider sdk KhronosOpenGLES1xMBX.asp OpenGL..

Has anyone implemented the PayPal API through a native iPhone app?

http://stackoverflow.com/questions/779423/has-anyone-implemented-the-paypal-api-through-a-native-iphone-app

METHOD SetMobileCheckout AMT .2f CURRENCYCODE USD DESC @ RETURNURL @ userName password signature self.donationAmount @ Some Charge returnCallURL NSLog parameterString NSURL url NSURL URLWithString paypalUrlNVP NSMutableURLRequest theRequest NSMutableURLRequest..

URL encode an NSString

http://stackoverflow.com/questions/8088473/url-encode-an-nsstring

NULL CFStringRef unencodedString NULL CFStringRef @ ' @ # kCFStringEncodingUTF8 Some good reading about the subject Objective c iPhone percent encode a string Objective C url encoding http cybersam.com programming..

Are there any good UIScrollView Tutorials on the net?

http://stackoverflow.com/questions/820557/are-there-any-good-uiscrollview-tutorials-on-the-net

links are highly appreciated This goes to community wiki. iphone uikit uiscrollview share improve this question Some good samples with the basic functionalities covered very simple uiscrollview demo Scrolling UiScrollViewTutorial implementing..

TouchMoved and wrong screen range? or Bug in iOS?

http://stackoverflow.com/questions/13222013/touchmoved-and-wrong-screen-range-or-bug-in-ios

mode you get points in range 5.5 .. 469 ... i can't explain this it happens only on device in simulator it works fine. SOME DEBUG INFO with status bar and NO wantsFullScreenLayout range is 25.5 .. 449 with status bar and YES wantsFullScreenLayout..

Memory Troubles with UIImagePicker

http://stackoverflow.com/questions/2921560/memory-troubles-with-uiimagepicker

freeing up. I know it's not telling me about the actual memory footprint of the UIImages themselves but it gives me SOME numbers at least so I can see that SOMETHING'S happening. Sorry for the hamfisted way I build that NSLog message too I was.. about the actual memory footprint of the UIImages themselves but it gives me SOME numbers at least so I can see that SOMETHING'S happening. Sorry for the hamfisted way I build that NSLog message too I was going to fire another UIAlertView but..

Api Facebook iphone , possible to post to a friend's wall

http://stackoverflow.com/questions/4126400/api-facebook-iphone-possible-to-post-to-a-friends-wall

@ another text forKey @ action_links params setObject @ Yet another text forKey @ attachment params setObject @ SOME FACEBOOK ID forKey @ target_id At some point you need to create the following Facebook instance facebook dialog @ stream.publish..

Converting NSString into uint8_t

http://stackoverflow.com/questions/4782327/converting-nsstring-into-uint8-t

option is to allocate memory and copy the bytes but you will still need to track the length somehow. NSData someData @ SOME STRING VALUE dataUsingEncoding NSUTF8StringEncoding const void bytes someData bytes int length someData length Easy way..

iPhone - Crash using addObject on a NSMutableArray

http://stackoverflow.com/questions/4893043/iphone-crash-using-addobject-on-a-nsmutablearray

param is filled from a caller view by something like NSMutableArray filledArray NSMutableArray arrayWithObjects @ SOME TEXT nil nextController.param filledArray NSLog @ @ self.param just before the crash gives 2011 02 04 02 01 17.205 Learning..

Using AVAssetReader to read (stream) from a remote asset

http://stackoverflow.com/questions/6242131/using-avassetreader-to-read-stream-from-a-remote-asset

11800. In case of b and c retrieving the AVURLAsset from the AVPlayer AVPlayerItem or AVAssetTracks returns SOME object but accessing the 'tracks' property on it always returns an empty array. In case of d I'm able to retrieve and isolate..