iphone

iPhone/Cocoa Coding Standards

Are there any generally-accepted coding standards (naming, casting etc) that apply specifically to iPhone/Cocoa/Objective-C? I know Microsoft has published similar standards as they relate to .Net and C# but haven't run across anything related to the iPhone world. ...

NSDecimal multiplication

Hi all, I have a core data-based app that stores several properties in the decimal and float data types. I'm writing some transient properties / virtual accessors that run calculations and return some derived numbers, but I can't seem to get NSDecimalNumber multiplication to work. Why does this not work: - (NSDecimalNumber *)discount...

TTPhotoViewController thumbnails rotate but images don't

I have PhotoTest1Controller very similiar to the one in Three20 samples. I implemented necessary shouldRotate methods in necessary places in UITabBarController and UINavController derived classes as well as the table that contains PhotoTest1Controller. A funny thing is happening, when in thumbnail mode, the view rotates properly, but wh...

Why does NSFileManager return TRUE on fileExistsAtPath when there is no such file?

NSFilemanager is returning true for the following, when there should not be any such file there yet. What is happening? if([myManager fileExistsAtPath:[[self documentsDirectory] stringByAppendingPathComponent:@"Music/songlist.txt"]]){ NSLog(@"file is there"); } ...

Is it possible to tie a subscription to a iTunes account with in-app purhcase?

We're trying to implement a subscription service with in-app purchase in our app. The problem is our service does not require a user account for the past year of service. Users simply use this service with advertisements shown. We want to give them a subscription where they can buy for say, 3 months to have the advertisement removed. Ho...

How do I set the sample rate of an audio recording within Objective C?

How do I set the sample rate of an audio recording within Objective C? ...

iPhone sdk, at dismissModalViewcontrollerAnimated, the parent change y origin coordinate

Hi guys, my first post here :) I'm having a small trouble with a small but boring problem. I have a view, with a NavigationController. I load in the NC a simple view. Inside this view there's abutton where I fire the presentModalView... in the main view, not on NC, but it's parent view: ABVIEW > NC > NEWVIEW new attach a presentModalVi...

How to save an NSMutableArray of images as a Photoshop file

I found Layers that will save the project as a Photoshop file that can be edited as Photoshop, but how do I do this? ...

Core Data NSPredicate to filter results

I have a NSManagedObject that contains a bID and a pID. Within the set of NSManagedObjects, I only want a subset returned and I'm struggling to find the correct NSPredicate or way to get what I need out of Core Data. Here's my full list: bid pid 41 0 42 41 43 0 44 0 47 41 48 0 49 0 50 43 There is a paren...

iPhone: Animating a view when another view appears/disappears

I have the following view hierarchy UITabBarController - UINavigationController - UITableViewController When the table view appears (animated) I create a toolbar and add it as subview of the TabBar at the bottom of the page and let it animate in with the table view. Same procedure in other direction, when the table view disap...

How to achieve the same effect like the unlock slider in the welcome screen of iPhone OS?

I need to do something similar, where an animation highlights the text of a button to show that it must be slided to do something. Just like that unlock thing on the iPhone. How is that done? Is there a tutorial how to achieve this effect? ...

How can I create a footer/toolbar in an iPhone web app?

I'm working on a web app and I need to get a div to stick to the bottom of the viewport. Always viewable and always on the bottom of the viewport. There's an example of what I want here: footer. Unfortunately, this doesn't work on the iPhone. I can think of some ways to do this using javascript but I would rather not. Any ideas on h...

Peer to peer over 3G

Hey I'm trying to get a CFStream connection going over 3G. I can get it working over wifi using the host name, but when I try to connect directly to the ip address it fails. Is there a guide out there on how to connect over 3G? Thanks ASH ...

iPhone: UITableView, Dragging Table Contents Causes Crash

Hello, I'm new to iPhone application development. I'm trying to understand how to use UITableView. I'm wrote simple code: - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView { return 1; } - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { return 1 ; } - (UITableViewCel...

Stop action in view when uinavigationcontroller clicked back to previous view on iPhone

I have a uinavigationcontroller with 2 views. In the second view I have some audio playing. When I click the back navigation item on the navigation bar the audio still plays. How do I end the process of anything happening in the second view when the user clicks back to the initial view. Thanks for your help. ...

Building iPhone static library for armv6 and armv7 that includes another static library

Hi, I have an Xcode project that has a "master" static library target, that includes/links to a bunch of other static libraries from other Xcode projects. When building the master library target for "Optimized (armv6 armv7)", an error occurs in the last phase, during the CreateUniversalBinary step. For each .o file of the libraries tha...

How do I set an Integer in a UITextfield using Core Data?

I can set text in my managed object like this... [editedObject setValue:textField.text forKey:editedFieldKey]; but I can't set this... [editedObject setValue:numberField.text forKey:editedFieldKey]; In the XCode Template I can set this straight into the Managed Object but like this... setValue:[NSNumber numberWithInt:200] forKey:@...

Core Data: Mass updates possible?

Is it possible to do mass updates on a given entity in Core Data? Given an Person entity for example, can I do something like this: Person.update(@"set displayOrder = displayOrder + 1 where displayOrder > 5") Or is my only option to fetch all the entities needed and then loop through and update them individually??? Thanks ...

IB plug in for CALayer subclass

Hi I am developing a game with dozens of levels and each level has a unique layer tree with objects that are a subclass of CALayer. I would like to use Interface Builder to set up and layout each level, is it possible to create an IB plug-in for my CALayer subclass which would let me do this? The documentation refers only to subclasses ...

iPhone: Changing CGImageAlphaInfo of CGImage

I have a PNG image that has an unsupported bitmap graphics context pixel format. Whenever I attempt to resize the image, CGBitmapContextCreate() chokes on the unsupported format I receive the following error (error formatted for easy reading): CGBitmapContextCreate: unsupported parameter combination: 8 integer bits/component; ...