ios

How to make UITextView "Done" button resignFirstResponder?

I am trying to make my editable UITextView resign the keyboard (resignFirstResponder) when the user taps "Done." Using a UITextField, I have been able to do this with the following code: - (IBAction)doneEditing:(id)sender { [sender resignFirstResponder]; } ... and then to attach it to the relevant UITextField in Interface Builder ...

PDF calculate Glyph sizes

I (think) have every values for Text-Rendering in a PDF. * Position (Text Matrix) * FontDescriptor with Widths Array * FontBBox * StemV/StemH * FontName * Descent * Ascent * CapHeight * XHeight * ItalicAngle My problem is I don't know what to do with these values. I went through the PDF Spec 1.7 a couple of times and cannot find a for...

iOS API detect wireless networks

Is there an API in CocoaTouch/iOS for detecting wireless networks? I want to write an app that saves a list of networks the phone can see at a given moment. ...

Deselecting the table view row when returning

I followed Luke Redpath's suggestion here - http://stackoverflow.com/questions/2803061/selected-uitableviewcell-staying-blue-when-selected - to deselect the row when returning to the original table view, but I can't get it working. In fact the method doesn't get triggered. - (void)viewDidAppear:(BOOL)animated { [super viewDidAppear:an...

When does NSURLConnection's initWithRequest return nil

Does anyone know in which situations initializing a NSURLConnection returns nil instead of the created connection. The documentation says it's possible but fails to specify when this happens. The method/message in question: [[NSURLConnection alloc] initWithRequest:request delegate:self]; - According to the NSURLConnection Class Refer...

Unique items from a NSMutableArray with NSDictionary items?

If you have an NSMutableArray with three NSDictionarys like this: { name:steve, age:40; name:steve, age:23; name:paul, age:19 } How do I turn that into an array with just two strings { steve, paul }. In other words, the unique names from the original NSMutableArray? Is there a way to do this using blocks? ...

NSLocaleUsesMetricSystem always YES on iPad

Hi I am trying to decide if the users Region/Locale settings validates the use of Metric values (in this case if kg or lb should be appended). I am running 3.2 on my iPad and on the simulator(Xcode 3.2.4). I have tried out a few different Region settings but I simply can not make it return NO for NSLocaleUsesMetricSystem NSLocale *lo...

Can Core Data lazy-fetch a BLOB attribute on iOS?

I'm storing a photo as a Transformable attribute in my Core Data entity, which is a lot of data to load in an iPhone's memory. If I want to present a TableView that lists all of the entities (potentially hundreds or thousands), but only need to display their title, will Core Data still fetch each photo and store it in RAM before it's nee...

Adding "Open In..." option to iOS app

On iOS devices, the Mail app offers "Open In..." option for attachments. The apps listed have registered their CFBundleDocumentTypes with the OS. What I am wondering is how my app might allow users to open files generated by my app in other apps. Is Mail the only app that provides this feature? ...

What are the first things people do when starting a new iOS project?

Hello, world! I recently started diving into iOS development and am happy to announce my first free app has been approved by the App Store (don't worry, I won't spam it on here)! Now that I feel more comfortable with building iOS apps, I'd like to begin building out some ideas I have for more advanced, paid apps. As such, I need to co...

iOS iPhone shows nothing when run

so I followed the tutorial at http://icodeblog.com/2008/08/08/iphone-programming-tutorial-populating-uitableview-with-an-nsarray/ It compiles and run successfully but it only shows Fruits at the top and no items. Same thing happened when I followed another tutorial. Does anyone know how to fix this or what the problem is? ...

How to exclude frameworks in simulator builds in Xcode

How can I exclude libraries which I have compiled only for the iOS device architecture (libssh2, etc.) from an Xcode project when I am compiling the app to run on the simulator? ...

Writing classes that work in both iOS and Mac OS.

What is a good way to write classes that can be used in both iOS and Mac OS applications? I'm not trying to get a full cross-platform UI solution here, just a way to use several model classes from my iPhone app in a support application running on the Mac. Some of those classes require a few minor changes to get them compiling under Mac O...

How to Play Two Videos Simultaneously in a UIWebView

I'd like to play two videos at the same time from an HTML page in a UIWebView. By default any playing video is stopped when another is started. This happens even if the two videos live in different web views. Is there a way to force continued play for the first video? ...

How do I record, playback, then continue recording to the same file

I'm looking at AVAudioRecorder in the iOS SDK and thinking it's not going to be able to meet my audio needs. What I'd like to do is be able to record some audio, then play back that audio to review it (simply using a slider), then be able to continue recording from the end of that file. I've gathered that I can use AVAudioRecorder to r...

Custom UITableViewCell and animation on setSelected:animated:

I have a UITableViewCell subclass that does its drawing in a drawRect: method. The whole rectangle is custom drawn, including the background. I was able to get very complex cells while keeping the scrolling very smooth. My problem: I call [table deselectRowAtIndexPath:path animated:YES]; whenever the view appears, in order to comply wit...

Universal iOS app crashing on iPhone/iTouch 3.1.3 due to UIPopoverController

I just updated my app so that it's a universal app. In doing so I added support for UIPopoverController in a certain place. Now the app seems to be crashing on 3.1.3 iPhone/iTouch devices: OS Version: iPhone OS 3.1.3 (7E18) Report Version: 104 Exception Type: EXC_BREAKPOINT (SIGTRAP) Exception Codes: 0x00000001, 0xe7ffdefe Crash...

How do i test my app data persistence during development?

Hi, My question is related to the following three questions. http://stackoverflow.com/questions/2099747/iphone-what-happens-to-previous-data-when-app-is-upgraded-to-new-version http://stackoverflow.com/questions/1223696/how-the-application-upgrade-works-in-iphone http://stackoverflow.com/questions/941479/upgrading-iphone-application-v...

Tips for an iOS developer to learn Mac programming?

As Apple announces the Mac App Store, I'm going to learn Mac programming. I am typically one of those who read the Beginning iPhone 3 Development book before the Cocoa Programming for Mac OS X book. The reason I bought a MacBook was due to the fact that Xcode runs only on OS X. So, what's your tips for an existing iOS programmer who is a...

Core Data: avoiding retain cycles in to-many relationships

I'm still learning my way through iOS development and working with Core Data and have just come across retain cycles. It is my understanding from reading the Core Data Programming Guide that after you're done working with a relationship, you use the managed object context method refreshObject:mergeChanges to ensure that the retain cycle...