objective-c

Is this unnecessary warning?

I have a following static method in one of my utility class + (UIImage *) getImage:(NSURL*) fromUrl { //Warning here NSData *urlData = [NSData dataWithContentsOfURL:fromUrl]; UIImage *image = [[[UIImage alloc] initWithData:urlData] autorelease]; return image; } For this method I'm receiving a bellow warning message war...

Changing backgroundview of a uitableviewcell to nil

Hi, I have a grouped table view and I don't want a see the background for a specific cell, because I put a picture in this cell. So in the cellForRowAtIndex, I put cell.backgroundView= nil;. But it don't works, but If reload the data of the tableview now the background of my cell disappear. How I can disappear the background on the first...

How do flags work in c?

Ok I want to add some sort of flag like variable to one of my classes and had some questions about going about doing it. After looking at some source that uses it I noticed some stuff like this. TEXTUREFLAGS_POINTSAMPLE = 0x00000001, TEXTUREFLAGS_TRILINEAR = 0x00000010, Does the way this work is by combining all the flags into one int...

subarrayWithRange with large data

iPad application I have a large text file which I want to divide into several pieces and process them in a loop. I used the following code: NSArray * contentArray = [stringFromFile componentsSeparatedByString:@" "]; for(...){ contentRange = NSMakeRange(lastPosition , newLength); NSArray * subContentArray = [contentArray subarr...

How to save my own object with NSKeyedArchiver??

Hi, i've got problems using the NSKeyedArchiver/NSKeyedUnarchiver for saving my object. I added the methods - (id)initWithCoder:(NSCoder *)decoder and - (void)encodeWithCoder:(NSCoder *)encoder. The problem is when i try to save the object it doesn't work correctly. I could imagine a problem (but I'm not sure if it is the problem ;) ). ...

OpenGL glTexParameter

Hey guys I just had a simple question. Does glTexParamter act on all textures or just the texture that is currently bound So like if I call this at the texture load: glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT); And this on another texture load: glTexParame...

'id' type object to NSArray problem

Hello, i have a NSDictionary and i get objects and keys in 'id' type format , with the following code: NSDictionary *temp =[[NSDictionary alloc]initWithObjectsAndKeys:array1,@"array1",array2,@"array2",nil]; NSInteger count = [temp count]; id objects[count]; id keys[count]; [temp getObjects:objects andKeys:keys]; Wh...

Persisting NSOperationQueue

Does anyone know how to persist an NSOperationQueue to disk between application launches? ...

iPad background thread NSAutoReleasePool confusion about [object release]

I have an app where I import a bunch of data and I want to to happen on a background thread. This was working well for a small amount of data but now it seems I am running into this error midway through the parsing and importing of large amounts of my data into Core Data: Program received signal: “EXC_BAD_ACCESS”. Here is the call to...

Why can't I add more than one object to table view controller through and IBAction?

I am trying to implement a favorites window for a quotes application. right now I have a button implemented with the following code: - (IBAction)next2 { [favoritesViewController.listData addObject:viewController.label.text]; [navigationController pushViewController:favoritesViewController animated:YES]; } here favoritesViewController...

Symbol not found: _OBJC_CLASS_$_NSURL error when launching on Mac OS X Leopard

I've just gotten a report from a user that a new build of my app crashes on his machine when he tries to launch it. The crash report is: Process: MyApp [222] Path: /Applications/MyApp.app/Contents/MacOS/MyApp Identifier: com.MyCompany.MyAppAppAndImporter Version: ??? (???) Code Type: X86-64 (Native...

Can i access background running apps on my app?

Is there a way i can access the apps running on the iphone and either cancel them? ...

How do you read/write/update m4u and mp3 file meta data using cocoa/objective c?

Are there some particular library files available on OS/X that are relevant, I am just not sure where to start. ...

How To Tell If an iPhone is in Sandbox Mode?

I have an iPhone application that has In App Purchases, and my application also pings my server whenever there is a successful or a failed IAP transaction, but I don't want to count IAPs that I make on my own test devices. How can I tell within the program whether or not I am in a sandboxed user account? ...

Xcode build phases

Hey guys I was wondering if in an xcode build phase if it was possible to get the users root directory. Right now I am trying to copy it to "~/" but it says that doesn't exist Is there another way to get the user directory (or the users short name)? Or is there a system folder I can write to that won't run into permission problems? ...

NSMutableDictionary error

I want to use NSMutableDictionary to cache some data i will use later. My custom object is following: @interface MyData : NSObject { NSRange range; NSMutableArray *values; } @property (nonatomic, retain) NSMutableArray *values; and implement: - (id)init { if (self = [super init]) { values = [[NSMutableArray alloc]...

Core Data, try to use NSPredicate to filter a toMany relationship set but get the "to-many key not allowed here" error

Here is the model I have: http://www.girardet.ch/model.png My goal is to retrieve all the Quotes with these criterias: belong to a specific theme : the name_en attribute of Themes order by relevancy filtered by Authors (with the alias attribute of Authors) Here is my code: NSFetchRequest *fetchRequest = [[NSFetchRequest alloc] init...

Using NSXMLElement to add a tag in the middle of a block of text.

I need to create an XML document with the following type of format. <Para> This is some text about <someMethod> that you need to know about. </Para> I'm having no issues with general XML generation, but this one aspect is giving me some issues. Thanks folks Scott ...

iPhone Formatted Strings

I would like to be able to format a string in a label or textfield so that i can change the font color and size of certain keywords. does anyone know how to do this? is it possible to find the actual physical dimensions of a CharcterSet as well? ...

How to synthesize members from another class

I have created a certain class to represent an object. My program has several views and view controllers. I want the different view controllers to work with this object. However, when I try to synthesize the class members so that they can be used in the view controller, I get an error saying that there is no declaration of the property f...