iphone

How to figure out at which position a string contains another string?

Is there a method that could tell for a string like "foo bar Foo Bar one two three" at which position the string "Foo" is contained, case sensitive? ...

listing of all methods of a control - like required - iPhone

yesterday I just asked following question. http://stackoverflow.com/questions/1349571/how-to-customize-tableview-section-view-iphone I found some new method. Even in apple documentation I didn't found this method. Is it some thing like hidden methods? Does anybody provides all methods listing? Including sample code. Say for example....

Why is my sizeWithFont:constrainedToSize:lineBreakMode: always returning zero?

I'm trying to make a UITableViewCell that adjusts its height based on the length of a string it's displaying, but am getting hung up on this method. Here's what I've got: NSString *text = @"A really long string in here"; CGSize theSize = [text sizeWithFont:[UIFont boldSystemFontOfSize:18.0f] constrainedToSize:CGSizeMake(265.0f, MAXFLOA...

targeting iPhoneOS 2.2.1

I don't believe that I am using any 3.0 specific APIs, but somehow whenever I compile I get a warning "This project uses features only available in iPhone SDK 3.0 and later", and then a bunch of errors. If I change the Base SDK to 3.0, the warning & errors go away, but then of course I cannot target OS 2.2.1 I see that this is coming...

Core Graphics has poor PIXEL iteration performance on iPhone?

I am trying to do an iteration on pixels to change the RGBA values of a UIImage without using OpenGL. I tried testing out iteration performance using the below code but was very displeased. It seemed like I could only get a few thousand iterations per second. And for a UIImage with several hundred thousand pixels, this would take way TOO...

Get tableView:heightForRowAtIndexPath: to happen after tableView:cellForRowAtIndexPath: ?

I've got some UITableViewCells that need to change their height depending on the length of the strings inside. I'm calculating the necessary height inside tableView:cellForRowAtIndexPath:, and then storing it in a variable (self.specialRowHeight). Then I've got: - (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIn...

NSURLConnection. How do I grab just HTTP header information?

The title to this question says it all. NSURLRequest + NSHTTPURLResponse is clearly the way to role. How do I just grab the header info? Cheers, Doug ...

How to get UIImage from EAGLView?

I am trying to get a UIImage from what is displayed in my EAGLView. Any suggestions on how to do this? ...

Send a message to a view controller using -tabBarController:didSelectViewController?

I'd like to send a message to a UITableViewController that is attached to a TabBarController, and has a naviagation bar. However, I'm not sure what to do to send the message. Currently (for testing purposes), I have: - (void)tabBarController:(UITabBarController *)tabBarController didSelectViewController:(UIViewController *)viewControlle...

Which is faster? Using Quartz & CGRects vs an array UIImageViews

Just wondering weather its faster, if you have lots (~several hundred to a thousand) 2D images, to use Quartz or an array of UIImageViews. Cheers! ...

How to NSLog pixel RGB from a UIImage?

I just want to: 1) Copy the pixel data. 2) Iterate and Modify each pixel (just show me how to NSLog the ARGB values as 255) 3) Create a UIImage from the new pixel data I can figure out the the gory details if someone can just tell me how to NSLog the RGBA values of a pixel as 255. How do I modify the following code to do this? Be Speci...

Dynamically change url or WordPress theme if UserAgent is iPhone.

Is there any way to do this? My website is http://kennethreitz.com. Its driven by some moderate PHP on top Wordpress. My options are to detect if the user is using an iphone, and if they are either a) tell wordpress to load a different "theme" that i have written. b) if this isn't possible, have a different wordpress installation on ...

How do you "ping pong" a UIView image sequence animation

Hi, I have a UIImageView which has a png image sequence loaded into it. My question is - Do you know of any way I can "ping pong" the animation sequence? So that it plays forward from 1-24 then plays backwards from 24-1 and loops. (technically it should be : 1-24 then 23-1 then 2-24 then 23-1...etc) - (void) loadAnim01 { mon01 = [[U...

Is is possible to make tableview section headers scroll with the cells in a plain tableview?

In a grouped tableview, the section headers and footers scroll with the cells. However, in a plain tableview, they are fixed to the top and bottom of the screen until the next section is reached. Is there a way to override this action and make the headers and footers scroll with the cells in a plain tableview? Thanks! ...

Where can I find sample iPhone code?

Sample code is one of the most useful tools for learning about programming. There seem to be many sources on the web for iPhone sample code, but some are harder to find than others. Here's a collection of links I've found so far. Does anyone know of some other sources for iPhone sample code? Apple Sample Code: http://developer.apple.co...

How to increase/decrease an Unsigned Char?

I am trying to modify pixel values (8 bits per channel RGBA) by numerically increasing/decreasing the values by a certain amount. How can I do this in Objective-C or C? The following code generates a "Error: EXC_BAD_ACCESS" everytime. // Try to Increase RED by 50 for(int i = 0; i < myLength; i += 4) { //NSLog prints the values...

inheritance in objective C

i am new to objective C.is it possible multiple ,multilevel,hybrid,hierarchical,all types of inheritance in objective C? ...

Playing audio files on the iPhone

I've made a simple app, where I have a list of songs. The user taps a list entry and the song begins playing. I've lifted the SoundEffect class from Apple's sample projects (e.g. Metronome, BubbleLevel). It seems to work fine with the following code: // declare in the .h file SoundEffect *audio; // setup - when controller loads audi...

Core Data Leaking Memory?

I keep seeing what appears to be a memory leak - but I can't tell what to do. It looks like a memory leak in Core Data. I can see the LAST method I explicitly invoke in Objective-C, but I'm not creating any object there. I'm saving something and Core Data is leaking memory according to Leaks. Am I reading this incorrectly? ...

Cell not updating value as UISlider value changed

Hello all. I have a question that is driving me crazy. It is all about updating, in realtime, an UITableViewCell with the value of an UISlider that is inside another UITableViewCell. The problem The cell is updated but It seems that the size of the Label in the cell does not addapt to the size of the value represented. I will try to ...