objective-c

TBXML While Problem

Hey everbody, I'm getting some trouble with TBXML and While. I'm trying to parse a couple of nodes of XML. My XML is this: <teste> 1 2 3 But when I set while, my app just crashes. itemsList = [[NSMutableArray alloc] init]; TBXML * tbxml = [[TBXML tbxmlWithURL:[NSURL URLWithString:@"http://localhost/dev/http/tes...

How to securely include secret key/signature in iOS/Cocoa apps

I want to include a secret key into an iOS app so that the app can "prove" to a certain server that a request is coming from the app itself and not some other system. I know that simply hardcoding a secret key into the code itself is very vulnerable as anyone can jailbreak their phone and attach GDB to my app's process to get the key. ...

How do I create an NSURL using non-English characters?

I tried constructing the following NSURL for a custom URL scheme: NSURL *url = [NSURL URLWithString:@"tweetie:///post?message=안녕 모두"]; [[UIApplication sharedApplication] openURL:url]; but it doesn't perform correctly. How would you construct such a URL with non-English elements? ...

How to set iPhone video output image size

Hi, I'm trying to do some image processing on iPhone. I'm using http://developer.apple.com/library/ios/#qa/qa2010/qa1702.html to capture the camera frames. I saw that I can set AVCaptureVideoDataOutput image format using setVideoSettings, but is it possible to get the images in lower resolution? If not, is the an efficient way to downs...

How to define non string constants in objective-C?

Hi guys, I can define global strings like this: // .h extern NSString * const myString; // .m NSString * const myString = @"String"; Now I need to define UIcolor similarly, How can I do it? I'm trying: // .h extern UIColor * const myColor; // .m UIColor * const myColor = [UIColor colorWithRed:1.0 green:0.0 blue:0.0 alpha:1.0]; ...

How to use libpng with OpenGL for a 2D game?

I am beginning with OpenGL, and I want to make a very simple game with airplanes. Now I have a PNG of an airplane seen from above, and I want to draw this on the screen. Currently I only know how to draw triangles that rotate: float angle = 0.0f; void renderScene(void) { glClear(GL_COLOR_BUFFER_BIT); glPushMatrix(); glRotatef(angl...

Building a Sql client

Hi all, I'm looking to build a sql client for a school project on iOS. My first problem here is that I'm not sure what, if any libraries I need beyond what's provided to me in the SDK to make the proper server connections. Also any security concerns you might be able to point out here would also be appreciated. ...

PanoramaGL on iOS 4.0

Did any body use the panoramaGL from http://code.google.com/p/panoramagl/ ? How did you setup the project. I have changed the base sdk to 4.0 but I am getting 75 errors.:D If not is there any free library to do 360 photo on iPhone? Please help me. ...

It's possible to make a uitableviewcell draggable

Hi, I've this NIB file: and I want to make the tableviewcells draggable, but outsite the tableview. Is this possible? ...

How to get a price off google shops in iPhone sdk

I am writing an iPhone app where I need to take the first price of google products for a particular search, and then convert it into a float. Is there any way that this can be achieved, and if so, how? Thankyou in advance. ...

Is it possible to change the frame origins of an iPhone screen as is done when a statusBar is shown or hidden?

When a UIStatusBar is hidden in an app, the origin of all views is (0, 0), the upper left hand corner of the screen. However, when a statusBar is shown, the origin is still (0, 0) yet the views will move down as not to cover the statusBar. How is this working? Is it possible to duplicate this effect in code? Essentially, my end goal i...

OpenGL ES 2.0 multiple meshes? (just Real World Examples)

Hi guys! I`m a little confused about this point. Everything that I found in books, blogs, forums and even in OpenGl specs just talk about a very abstract techniques. Nothing about real world examples. And I`m going crazy with this: How to put and manage multiple objects (meshes) with OpenGL ES 2.x? In theory seems simple. You have a ...

iOS defaults db

I am off to making a tower defense game, and will have about 40-50 towers and about 20 enemies on screen. Those objects will have a few properties each, like hp, damage, speed etc. What is the limit of the defaults db? I don't feel like writing SQL queries for simply saving the state of my game.. ...

Autorelease object returned from NSArray?

I'm writing an NSArray category to include the -objectAtRandom message that returns an object from a random index (something similar to Python's choice). Should I autorelease this object before returning it? I believe I shouldn't, but I'm not sure... ...

Help with touchesMoved when dragging fingers

I'm implementing touchesMoved, touchesBegan, and touchesEnded on a few UIButtons, so that I can slide my fingers over them and have them call the appropriate actions. It seems to be working almost as intended, however, if I press two fingers outside of the two buttons' frames, and then slide them into the buttons' frames at the same tim...

Iphone Crash log not symbolicating UIKit calls

Has anyone ever seen a crash log like this before where the UIKit and other system libraries do not get symbolicated? One of our apps is having an issue with crashing on launch but only a small number of users (like 5) are experiencing the problem. (To my understanding the default.png is displayed and then it crashes) and we have been un...

Chaining Height of UIPiekcer Selection View

Is it possible to change the height of UIPicker "Selection View"? ...

Received memory warning

I am working on an app with xml parser, uiwebview, navigationcontroller, displaying a lot of images on the main controller, that remains in the memory throughout the whole life of the app. I store my data using core data. I tried to figure out the memory footprint of the application since I am getting the following warnings: Received me...

understanding self. in objective C

It's been 3 days since I've programmed in objective-C and I still don't quite understand the concept of self. When should we use a self. in an implementation code? If I understand this correctly if I have defined it as a property then I should use self. But then the question is why? I've been reading many i-phone programming books but ...

indexSetWithIndexesInRange is not doing what expected

I want to select some objects from an array. Therefore I'm using begin and end indexes of my selection. NSLog(@"start:%d\nend:%d", startIndex, endIndex); NSIndexSet *myIndexes = [NSIndexSet indexSetWithIndexesInRange:NSMakeRange(startIndex, endIndex)]; NSLog(@"%d", [myIndexes lastIndex]); The first NSLog gives me startIndex:49 ...