ios

SubView doesn't want to fit into specified frame.

The the problem arises when i dynamically load subview from nib and add it to the current main view during viewDidLoad. UIView *someView = // load from nib someView.frame = CGRectMake(.0, .0, kFormSheetWidth /* = 540.0 */, kFormSheetHeight) /* = 576.0 */; [self.view addSubview:some...

Profiling iPad/iPhone web application with Instruments

Hi, We're trying to determine why one of our web app ends up getting the Mobile Safari app killed on the iPad (works fine in the Simulator or even on the iPhone). Is it possible to profile a web application CPU/Memory usage by profiling Mobile Safari app via Instruments (either on the simulator, or even better on the device)? Thanks! ...

Setup an app to detect OS ver. and iPhone or iPad

How can I detect whether my app is running on an iPhone or iPad, and what OS version it is running? Can I use pre-processor macros in a similar fashion to #if _OS4.0 or #if IPAD or something of the sort? Is this kosher, or should I just make separate builds for submission? ...

XCode and SenTestingKit not outputting to the editor window

I am new to testing in Xcode. I am following the developer documentation "iOS Developement Guide" Unit Testing Applications. I have successfully added unit test bundles to my application with one failing test. When I build the test target the output shows 1 error as expected but the editor does not show the expected error message unde...

GLfloat handled differently by OpenGL ES iOS and OpenGL OS X?

First some context, I'm using OpenGL/ES exclusively for 2d drawing (eg. glOrtho(0, width, 0, height, -1, 1);). I'm drawing arrays of vertices with glVertexPointer()/glDrawArrays() On OS X vertex coordinates using GLfloat represent exact pixel coordinate values. On iOS I have to "scale" those same GLfloats using the following function (re...

Redrawing UIScrollView contents after every zoom

I have a UIView inside a UIScrollView. Whenever the UIScrollView zoom changes, I want to redraw the entire UIView at the new zoom level. In iOS < 3.2, I was doing this by resizing the UIView within the UIScrollView to make it the new size, and then setting the transform back to Identity, so that it wouldn't try to resize it further. H...

MPMoviePlayerController with custom controls

I added some custom controls to a MPMoviePlayerController. Ths is explicitly written in the documentation that tis is possible: You can add subviews to the view in this property. You might do this in cases where you want to display custom playback controls or add other custom content that is relevant to your application. But this w...

Advanced iPad programming

I finished learning the Big Nerd Ranch Guide to iPhone programming but now I need a more advanced book for advanced concepts particularly for iPad App Dev. Could you please recommend one? ...

Timezone/DST agnostic timestamps with NSDate

I'm creating objects which will be sent to a server, and I'm trying to ensure I account for timezone and Daylight Savings issues, so I want my timestamps to be "seconds since 1970" regardless of timezone, etc. Is [NSDate timeintervalSinceReferenceDate] sufficient for this? In the docs I know it says time since January 1 1970 00:00:00 GM...

iPhone Application Loader and Icon File extension

So i've got an iphone app that i've finished updating with high resolution graphics. Included in the update was adding a new high resolution icon ([email protected]) If i set the "Icon File" key in the -info.plist file to "icon" the icon displays expected on the device, however when i try to upload the application using application loader, ...

Does the iOS SDK come with a library of artwork/icons?

For example, sort of like visual studio does? Perhaps for gestures like pinch/swipe/etc? ...

Core Data cloud sync - need help with logic

Hi, I'm in the middle of brainstorming a cloud sync solution for a Core Data app that I am currently developing. I'm planning to open source the code for this once its done, for anyone to use with their Core Data apps, so input from the community on how this system should work is much appreciated :-) Here's what I'm thinking: Server S...

Does anyone know of a wrapper for the Addressbook framework for iphone?

Anyone know of a wrapper for the AddressBook framework that makes it a bit friendlier to use? ...

Check iPhone iOS Version

Hi, I want to check if the iOS version of the device is greater then the 3.1.3 I tried things like [[UIDevice currentDevice].systemVersion floatValue] but does not work, I just want a if (version > 3.1.3) { } Does anybody know how to do this? Thanks ...

Convert Image to B&W problem CGContext - iPhone Dev

Hello, I am using a method to convert images taken with the camera into black and white. The problem I'm running into is that if the picture is taken in Portrait mode, it rotates and stretches in the next view. But, if is taken in landscape it is just find. I can only duplicate this bug when I convert the image to Black And White. Here...

Getting device info in iOS?

I'd like to find out and store information about a users device. I'm looking for the date, the type (iPhone/iPod/iPad), the locale (Language) and location. The date should be simple to get, as is the device type. What code is used to find out the current locale/language of the device interface? ...

Creating .sqlite file from Core Data store?

I've seen tutorials in books and on websites that offer .sqlite files for download. The sqlite files are used for Core Data. How do I get a .sqlite file FROM an app or core data store on TO my desktop? ...

Keep 1 fixed UINavigationItem.RightBarButton in place throughout all views that are pushed to a UINavigationController

I would like to have a UIBarButtonItem that is in the right side of the UINavigationBar that is on all views that get pushed into a UINavigationController. I know how to set it on a view by view basis by putting it in each view's UINavigationItem.RightBarButton property but when I push or pop a view off the stack I would have to reset th...

Circumvent screenshot for iOS 4

I would like to clear a view before an application is switched away from, to change the launch image so that the next time the app is entered it will not display some insecure data. iOS 4 provides applicationDidEnterBackground and applicationWillResignActive...however, neither of these seem to be able to prevent the screenshot from bein...

Getting started with Core Data

I am having trouble understanding how Core Data works conceptually and in terms of code. I get that there is a coordinator and a context. I also get that there is state management. How do they work together? I don't understand how I can store, say, an image and a few strings as an object. Let's say I want to retrieve the image and the...