objective-c

Problem in UITableView custom cell

Hey all, I am trying to add custom labels to my cell in UITableView. When I try to do this the display is messed up and I am unable to figure out what exactly is going on. Please find the image below and I will post the method I wrote.. - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPa...

Managing NSNotification along with UITabBarController interactions

I have 1 main UIViewController that contains a UITabBarController. The tab bar controller has 4 UIViewControllers (each managed by UINavigationControllers). Succinctly, it looks like this: MainViewController | |--- FirstUIViewController | |--- SecondUIViewController | |--- ThirdUIViewController | |--- FourthUIVi...

Get newest object added to NSFetchedResultsController?

Not even sure if this is feasible, but here's the use case: I have a RootView tableview that uses NSFetchedResultsController to manage the list. I tap an add button, which presents the AdditionViewController. The AdditionViewController uses a separatemanagedObjectContext to create the new object. On Save, the object is passed back to th...

How quickly does the iPad respond to touches?

I'm talking, how much time can be expected to elapse between the user touching the screen and something like touchesBegan being called? (Or something lower level, if such a thing is available.) Sub-millisecond? Multiple milliseconds? Tens? ...

Custom UITableViewCell fast scrolling

I have an UITableView showing custom view cells that I've designed in interface builder. It has quite many buttons and labels and a gradient background, which makes the scrolling performance sloppy, it "lags" every time a new cell loads. I've read the guide from the guy who created Tweetie about fast scrolling, and it says it's best to d...

change width of a uitableviewcell

Hi, I try to change the with of a cell in a tableview, I don't do a custom cell, I just subclass uitableviewcell. This is the class @implementation customCell - (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier { if (self = [super initWithStyle:UITableViewCellStyleDefault reuseIdentifier:r...

Style: objective c and token concatenation

This is a style question: Because Apple reserves the "_" privatization for its keywords, I was thinking of something along the lines of the following: #import <Cocoa/Cocoa.h> #define _(name) pvt_##name @interface SFMeasureViewController : NSViewController { @private NSTextField *_(label); } @property (retain) IBOutlet NSTex...

Enumerating a NSArray of different objects

NSMutableArray *array = [NSMutableArray arrayWithObjects:@"Hello World!", [NSURL URLWithString:@"http://www.apple.com"], nil]; for (id *object in array) { NSLog(@"Class name: %@", [object className]); } Given the above array of varying objects what is the proper way to fast enumerate thru them? Using the above code I do see my log st...

How can I detect a touch entering the frame of a UIButton?

Hi, I'm writing a class that implements a piano keyboard. Right now it's just a UIView and each key is a UIButton. I'd like the user to be able to drag their finger and hit several keys, but right now it only registers touch down. I've added UIControlEventTouchDragEnter as a way to trigger the key event but it only works if you hit a ke...

Uitableview cell custom unique ID

Hi all I have a table view and when a user selects a cell I want to log a unique id. I thought I could use the index but the numbers are not sequential (I.e. 1,4,5,9,etc). Is there a way of defining a custom index or ID for a cell? So I have the following cells in a table: dog cat fish the above cells have ids as below 2 dog 4 cat 8...

What is this UI element called? for iphone

The one that asks you to select a wireless network? It looks like a UIAlertView and UIPickerView combined? How do you use it ...

Objective-C save cookies from ASIHTTPRequest post?

Hi Guys, So I have poured over the ASI documentation but can't seem to find anywhere that says whether or not it is possible to capture the cookies from a post. Is there any method that rips out the session cookies into a dictionary or something from a request? Thanks! ...

Unable to trust a self signed certificate on iphone.

I am currently trying to connect to a server with a self signed certificate. I am using NSURLConnection to connect to the server. How can I make sure that I only trust the right server and cancel all other connections? I am using the following code - (void)connection:(NSURLConnection *)connection didReceiveAuthenticationChallenge:(...

UIImage - How dow I keep track of an index?

Hi I have started creating a simple product image carousel. It basically comprises of 3 visible UIImageViews' and 2 hidden UIImateViews'. The UIImageViews are populated with images from an array and animate to give the appearance of of a carousel. My next objective is to determine which product the user taps and push a detail view onto...

How do I send a delete request with ASIHTTPRequest?

Wondering how I can send a DELETE instead of POST/GET etc with ASIHTTPRequest. Thanks! ...

How to convert std::string to NSString?

Hi I am trying to convert a standard std::string into a NSString but i'm not having much luck I can convert successfully from an NSString to a std::string with the following code NSString *realm = "Hollywood"; std::string REALM = [realm cStringUsingEncoding:[NSString defaultCStringEncoding]]; However i get a compile time error when i...

Sending and receiving mail - objective-c

Is there a framework that does such a thing. It's really important that it can check mail and get it's contents. For example: If(newMessage hasSubjectEqualTo:@"woodviolins") { } And If(contents of new message has "hey" in it) {} ...

How to open appStore from web link?

I'm able to open my appStore page a click event on a UIButton that has an IBAction associated, similar this: - (IBAction) BuyFullAlbum { NSString *iTunesLink = @"http://phobos.apple.com/WebObjects/MZStore.woa/wa/viewSoftware?id=..."; [[UIApplication sharedApplication] openURL:[NSURL URLWithString:iTunesLink]]; ...

AES128 iphone encryption matches until the very end

I'm trying to encrypt data to be transferred back and fourth between a server but I can't seem to get the right output in objective-c: (full code here: http://pastebin.com/zPdHxShu) // 128-bit key, CBC mode // ------------------------ // IV = '1234567890123456' // (hex: 31323334353637383930313233343536) // Key = '123456789012345...

need help with memory management

so i have a program i am developing and as im fairly new to objective-c and cocoa touch im not very familiar with the concepts of memory management in ipad app development. my problem is that my program keeps crashing without any warning and without telling me why, i turned on breakpoints and it shows an exc_bad_access signal. which lead...