objective-c

Coloration of UIButtons of type UIButtonTypeRoundedRect

I would like the rounded rectangle portion of the subject type of UIButton to be a solid custom color I specify. I understand that . setTitleColor : changes the text color . backgroundColor : changes the color of the four pie-shaped corner pieces behind the rounded rectangle The question is how to change the color of the rounded recta...

Objective-C accessing / changing array elements in a multidimensional array (NSArray)

I'm trying to change a value in a multidimensional array but getting a compiler error: warning: passing argument 2 of 'setValue:forKey:' makes pointer from integer without a cast This is my content array: NSArray *tableContent = [[NSArray alloc] initWithObjects: [[NSArray alloc] initWithObjects:@"a",@"b",@"c",nil], ...

Updating a Current CoreData Store

How would you update a CoreData store with a new/updated data model? ...

Change Sprite Anchorpoint without moving it?

Hello, I am trying to change my Sprite anchor point so that I can rotate over a 0.0f,0.0f anchorpoint. At first my object is rotation at the default anchor point (0.5f,0.5f). However later on I need it to rotate over a 0.0,0.0 AnchorPoint. The problem is I cannot change the anchor point and change the position accordingly, so it stays...

Parsing SQL file in Objective-C

Does anyone know of an Objective-C library that will easily allow developers to parse a SQL file? I am building an iPhone application that contains a SQLite database and I am attempting to come with a system to upgrade a user's writable database. After reading a lot of the questions and answers on this site it appears that the best way t...

ASIHTTPRequest crash in ASIInputStream forwardInvocation:

Does somebody else has randomly seen crashes in ASIInputStream forwardInvocation: during the use of ASIFormDataRequest? (the request was startAsynchronous) Here is the backtrace: #0 0x95877b83 in CFRunLoopSourceSignal () #1 0x958daa45 in _CFStreamScheduleWithRunLoop () #2 0x9588d05d in __invoking___ () #3 0x9588cfc8 in -[NSInvocati...

tableView resize problem when pushing another view while keyboard is showing

I have a tableview controller under a navigation controller. Some of my table cells contain text fields, so when I tap on them, a keyboard will show up and automatically resize (shrink) the bounds of my tableview. The bounds is then restored when the keyboard is dismissed programmatically by calling resignFirstResponder on my text field....

How to refer to an object instance created/instantiated in interface builder?

When working in interface builder you can layout your interface with different types of objects but I'm unclear as to whether these are instances of objects or some sort of factory method or something like that. Basically if you use Interface builder to layout your objects, especially with subclasses of uiview, how do you refer to a spec...

iPhone Dev - "More" TabBarItem - how to change the title?

Hi, guys! I'm using TabBarController and I have more than 10 View Controllers in it (that's why I can see "More" tab, where I can access the rest of the views). My question is: Is there any way to change the title of the "More" tab bar? (I know how to change the title of the view: tabBarController.moreNavigationController.navigationBar...

Cocoa / Objective-C: Access a (Boolean) variable in different Classes

Hey People^^ Situation: Noob / Xcode 3.1 I have an AppView (NSView subclass) and an AppController (NSObject subclass) in AppView.h i declare a boolean (BOOL: booleanDraw), which i set to 'NO' in AppView.m When a button is clicked it 'launches' an action (AppController .h/.m) now i want to change booleanDraw to YES when the button is ...

Target Membership grayed out ( disabled )

I'm trying to create a new unit test build target for my iphone app. The problem I'm running into is that my source code "group"'s Target Membership options are grayed out. I did delete the original "Classes" folder, and created new "SourceCode" folder with an actual disk structure (thanks xcode). I imported it as a group, not a folde...

cocoa / Objective-C: Cross- Class Variables

Hey i was searching for a solution for my problem and i nearly have it just one tiny bit... I have a NSView subclass (AppView) and a NSObject subclass (AppController) In AppView i declare a boolean with the @property than i use @synthesize and than in AppController i want to access it: i found this: (in the implementation) AppView *ob...

Xcode warning: "NSArray may not respond to -addObject"

In my header file, I have this code: @interface TableViewController : UIViewController { IBOutlet UITableView *tblListData; NSArray *arryData; } In my class declaration file, I have this implementation: - (void)viewDidLoad { arryData = [[NSArray alloc] initWithObjects:@"iPhone",@"iPod",@"MacBook",nil]; [super viewDi...

NSArray assignment

Hi Guys - I have two viewControllers and one has to pass an array to another, but on receiving side i am always getting count 0. here is what i did classA.h Class A : UIViewController { @private NSMutableArray *_array; } @property (nonatomic, retain ) NSMutableArray *array; @end classA.m @implementation @synthesis array =_ar...

UIWebView and NSURLCache have a troubled relationship

I am trying to solve 2 things in my UIWebView: Load local assets in place of remote ones, under the right conditions Load remote assets as normal if there are no local ones or they are outdated Allow the webview to go "back" without needing to reload it's html form the server So to handle #1 and #2, I implemented a custom subclass NS...

iPhone memory leak help

This code is leaking, the performance tool blames two leaks on this block of code. If i comment it out the leak doesn't happen. Any help pinning it down would be greatly appreciated. Leaks: Malloc 48 bytes NSCFarray 32 bytes Code Block: NSArray *myArray = [[NSArray alloc] initWithObjects: @"Add", @"Edit", nil]; segmentContro...

Updating a current CoreData entry

How do you update a existing core data entry? ...

Objective-C Unit Tests cannot find my resources

When i run unit tests it fails on loading external resources (images) with the same error as if they don't exist. In xcode i have added the resources to the unit test target. I don't know what to try next. I am using the Cocos2d framework, I try to load the following code within a unit test AtlasSpriteManager *at = [AtlasSpriteManage...

How can you share ivars between classes.?

In one classes .h i have NSMutableArray *rountines; and in another classes .m i want to do something like this [routines addOject:@"Hello]; the other class is an ModalViewController type set up. So, in essence i'd like the .m file of the MVC to be able to read, and edit and do other things to the ivars i declare in the header. ...

Difference between addSubview: and insertSubview:atIndex: ?

When adding subviews to a UIView, what's the difference between the methods addView: and insertView:atIndex:? ...