objective-c

Passing argument makes pointer from integer without a cast

Does anyone know why I am getting the following error: - (void)tableView:(UITableView *)tableView accessoryButtonTappedForRowWithIndexPath:(NSIndexPath *)indexPath; { id result = (Possession *)[possessions objectAtIndex:[indexPath row]]; [result setRowSwapped:TRUE]; //Passing argument makes pointer from integer without a cast } //Th...

having trouble upload image from iphone Photo Picker to a server using ASIFormDataRequest

Basically I am trying to upload an image using ASIFormDataRequest. This is my following code ASIFormDataRequest *request = [ASIHTTPRequest requestWithURL:urlImg]; [request setRequestMethod:@"POST"]; [request addRequestHeader:@"Content-Type" value:@"application/xml"]; [request setDelegate:self]; [request setTimeOutSeconds:500]; NSData...

Why doesn't this NSPredicate work?

I have a very simple NSPredicate as such: NSPredicate *sPredicate = [NSPredicate predicateWithFormat:@"name beginswith '%@'", theString]; [matchingTags filterUsingPredicate:sPredicate]; This causes the array to have 0 results when theString == "p" However, when I do this: NSPredicate *sPredicate = [NSPredicate predicateWithFormat:@"...

Parsing `<media:content>` RSS feed tags using touchXML

Hi, I have the following RSS feed that I'm trying to parse using touchXML for an iphone application. <rss version="2.0" xmlns:media="http://search.yahoo.com/mrss/" xmlns:dcterms="http://purl.org/dc/terms/" xmlns:ext="http://ooyala.com/syndication/ext/" xmlns:mediasl="http://www.slide.com/funspace/developer/" xmlns:itunes="http://www.it...

Mouse tracking daemon

Hi gang, I need to write something using Cocoa to surface raw mouse movement data. Optimally, the app would just be a little daemon that would run, passing the data to a socket server which another application could tap into to gain access to the events. Can anyone point me in the right direction with regard to approach and tools? I ...

Destructor in Objective-C++

I have an objective-C++ class which contain some honest C++ object pointers. When the Obj-C++ class is destroyed does it call dealloc immediately? If so, then is the best way to destroy the C++ class by putting delete obj in the dealloc method? ...

Storing a CALayer/CGLayer on disk with iPhone

I have a CGLayerRef with content on it. How can I store this so that the app can quickly retrieve it and display it again? I tried converting it to a PNG and storing using Core Data but it's pretty slow to display, so I was wondering if there was a better way. ...

Anything faster than a UIButton?

Hi, I'm writing an iPhone app which needs an extremely rapid response for a touch event. Is there any object that will provide a faster response than the UIControlEventTouchDown result of a UIButton loaded from a nib? I'm open to any resources that don't require extensive digging around or reverse engineering. Thanks in advance! Luke ...

How do i enable code blocks in an xcode iPhone project?

I'm trying to enable code blocks in our iphone application so that i can run the static analyzer tool included with xcode. I get this warning (or error, depending on which compiler i use) when i run the build and analyze task: /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.0.sdk/System/Library/Framewor...

A way to implement a sideways NSTextFieldCell?

I have an NSTableView in my application with data being drawn in for both the X and Y axes (ie, every row is matched with every column.) I've got the data populating the cells the way I'd like, but it looks terrible with the columns stretched out horizontally. I would like to turn the NSTextFieldCell on its side, so that the text is wri...

iPhone 4 supporting High-Resolution Screens UIwebView

Hi there, I'm using UIwebView on my my app, but it doesn't support 960*640px, stuck at 480*320 How I can increase my resolution ? NSString *htmlFile = [[NSBundle mainBundle] pathForResource:@"checker" ofType:@"html"]; NSData *htmlData = [NSData dataWithContentsOfFile:htmlFile]; [webView loadData:htmlData MIMEType:@"text/html" textEncod...

Is this a memory leak in Obj-C ?

int someFunction (CLLocation *currentLocation) { double latitude = 12.3f; double longitude = 22.5f; CLLocationDistance d1 = [currentLocation distanceFromLocation: [[CLLocation alloc] initWithLatitude:latitude longitude:longitude]]; return 0; } ...

Sparkle framework delegation question

I have a wrapper application which launches a bundled application and then immediately quits (using [NSApp terminate:nil]). I would like to include Sparkle in this wrapper (it's not going to be possible to include if for the bundled app itself), and I've implemented it without any issues: so long as I comment out the NSApp terminate line...

What happens when an iOS device cannot allocate memory? (eg. when it has run out of memory)

If an iOS device cannot successfully [NSObject alloc] (because it is out of memory), will it return nil, throw an exception, or will the OS terminate the app? ...

How can I fade out text on a cell when I press edit button?

Hi, I would like to make my text label on a cell fade out when I press a button. I tried pointing the label I want to make fade out, but it just work for only last cell. And I found out that -(void) willTransitionToState:(UITableViewCellStateMask)state is the way to solve this problem, but I don't know how to use. Do I need to make a ne...

How to link an application classes to F-Script

I would like to create a command line application that accepts a script F-Script that is executed, and which has access to some classes exposed by the application. How is that done? PS: I am referring to F-Script, not FScript. ...

iPad iPod app album flip effect

Does anyone know how to implement the album flip effect in the iPod application on iPad? I want to have this effect when presenting a modal view controller. ...

Creating an alternative to bash for Mac OS X

Is a shell a normal CLI application, or is it different from an application that accepts input from standard input, and outputs the result on standard output? ...

How do I transpose a view's frame to it's superview?

Not even sure how to ask this. Transpose local coordinates to global? ...

How to recreate views released when memory warning is received.

If an application receives a low memory warning and a view controller releases the view, how does one reload the view the next time it's needed. I have my views defined in a .xib file and on earlier iphones, the views are being set to nil. Where/when/how do I recreate these views if they are removed? ...