objective-c

UIWebView mixes content of local files

I have multiple UIWebViews as child controllers of a UITableView with a Nav bar. The .xib file is the same for all the UIWebViews, but the UIWebView's content depends on the UITableView row selected. UIWebViews take their content from local .webarchive files (formatted text and images). If I click row 0 and UIWebView 0 appears, it look...

Pesky compiler error on iPhone app

Trying to get MGTwitterEngine app to build. Getting one pesky error. The following ERROR. ld warning: in /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS3.0.sdk/usr/lib/libxml2.dylib, missing required architecture i386 in file ld warning: in /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS3.0.sdk/usr/lib/lib...

Changing the size of UISearchBar

Hi. Not being able to find the answer, and also not being able to do what I want with CGSize searchBarSize = self.searchDisplayController.searchBar.frame.size; searchBarSize.width = ; I ask: is there a way to change the width of a UISearchBar? Tanks a lot. ...

App crashed on app store, not in local version

I ran into a horrifying bug when my app went live. It crashes in a spot where it had been fine. 1) download from app store using complimentary review code 2) start app 3) press start button 4) CRASH NOTE: crash reoccurs at every app startup until phone is rebooted - then it disappears When I try to replicate without the app store 1) st...

argument types of undocumented Objective-C methods in Instruments (OSX)

Is there a way to determine the argument types of Objective-C methods traced by Instruments? I created a custom DTrace Instrument that just lists all Objective-C calls in a class. I am trying to swizzle one of the methods, but only the method name is listed. Is there a way to determine the argument types? Or as an alternative, a way to ...

NSMutableArray: count is a method or a property?

I want to verify if I'm in the last cell of the UITable. Should I use a NSInteger property in my controller and store the value of the count of the data (it's an NSMutableArray) that populates the table? I'm asking because I don't know if count iterates over all objects of the array to count or if it only gets me a value of a count prop...

Thread and two dimensional array in objective C?

Hey, guys, I am just starting to wrap my head around objective C and I am doing a little project on Iphone. And I just encountered a weird problem. I had to deal with images in my program so I have a lot local variables declared like temp[width][height]. If I am not using NSThread to perform image processing, it works all fine. However, ...

Core data, sorting one-to-many child objects

So if I have a store of parents children and the parent has a one to many relationship to children (parent.children) and they all have first names. Now, on the initial fetch for parents I can specify a sort descriptor to get them back in order of first name but how can I request the children in order? If I do a [parent.children allObje...

CADisplayLink stops updating when UIScrollView scrolled

Title is quite self explanatory, but I have some animation being done in a loop triggered by CADisplayLink. However, as soon as I scroll a UIScrollView I have added to my view hierarchy, the animation stops immediately, only to return again when scrolling has completely stopped and come to a standstill.... Anyway to cancel this behaviou...

How does one properly redefine self while avoiding the "Multiple methods named ..." warning?

In Apple's The Objective-C Programming Language: Defining a Class the section named "Redefining self" recommends that that class methods allocate and return instances use 'self' only to allocate an instance and then refer only to that instance. Thus, I have a number of subclasses, that have class methods along the lines of: + (id)scroll...

UIScrollView with pages enabled and device rotation/orientation changes (MADNESS)

I'm having a hard time getting this right. I've got a UIScrollView, with paging enabled. It is managed by a view controller (MainViewController) and each page is managed by a PageViewController, its view added as a subview of the scrollView at the proper offset. Scrolling is left-right, for standard orientation iPhone app. Works well. B...

ViewController init?

I have just noticed that my ViewController does not call init (See below) when it starts up. -(id)init { self = [super init]; if(self) { NSLog(@"_init: %@", [self class]); otherStuff... } return self; } Is there a reason for this, or is it replaced by viewDidLoad -(void)viewDidLoad { otherStuff .. ...

The iPhone “phone” doesn’t have the provisioning profile with which the application was signed.

I have tried everything to fix this provision problem and nothing is working. I've reformated my Mac, reinstalled the iPhone, I've also dragged the provisions (developer and distribution) onto the Organizer, iTunes, and Xcode. In iTunes people say to drag the provisions to the iPhone icon but that doesn't work; it's only able to go unde...

releasing arrays objective-c

In Objective-c I have this: SomeObject *values[3][3]; when deallocating, as in C++ should I release element by element? Or if I do: [values release]; is ok? ...

take out objects from randomizer obj c

hello everyone, I'm a new "developer" trying to build some iPhone app I'm making an app which gets text from a list of objects in a NSArray and then randomizes them and display one in a TextView, here's the code: - (IBAction)azione{ NSArray *myArray= [NSArray arrayWithObjects: @"Pasta",@"Pizza",@"Wait",@"Go", nil]; int length = [myArra...

How to access pixels of an NSBitmapImageRep?

I have an NSBitmapImageRep that is created like this: NSBitmapImageRep *imageRep = [[NSBitmapImageRep alloc] initWithBitmapDataPlanes:NULL pixelsWide:waveformSize.width pixelsHigh:waveformSize.height ...

Core-data: when accessing a relationship, the count method on NSSet fails

I'm trying to access a relationship (one to many) programatically. My Data model contains an NSManagedEntity called language (with a two string attributes) with a relationship to an entity called WordCategory (one-to-many). I use an NSFetchRequest to get all the Language entities. that works fine. I get the valueForKey for the relationsh...

Determining if device can vibrate - iPhone vs iPod Touch

Developing an app that vibrates when a particular event occurs. I have a setting for turning the vibrate option ON or OFF. I would like to be able to disable the display of the vibrate setting for devices like the iPod Touch that do not have vibrate capability. I know I can do this by determining the device model using: UIDevice *thisD...

RPG Game loop and class structure (cocos2D for iPhone)

I'm looking to make an RPG with Cocos2D on the iPhone. I've done a fair bit of research, and I really like the model Cocos2D uses for scenes. I can instantiate a scene, set up my characters etc. and it all works really nicely... what I have problems with is structuring a game loop and separating the code from the scenes. For example, wh...

Implementing a horizontal compass on the iPhone - algorithm?

A horizontal compass looks something like this if you are facing due East (90 degrees). 85----90---95 If you were facing due 355 degrees northwest, it would look like this: 350----355---0 As you turn the compass, the number should cycle from 0 -> 360 -> 0 So, my question is, how would you implement a view like this on the iPhone? ...