cocoa-touch

Custom UIView and UIViewController best practices?

I currently have a simple iPhone app that loads a custom subclass of UIView. There's only one controller at the moment for the whole application, although there are several UIViews for separating the program logically. My current structure looks something like this: mainView : UIScrollView \__ has one subView : myCustomUIView : UIV...

UIButton outside of screen - won't work when layer moved

Hi, I have a UIButton, that's created outside of the screen on a UIView. By the touch of another button, the UIView scrolls up and the original button moves into the view. The problem is that the button is not touchable. I think Cocoa Touch optimizes buttons that are off screen, but how can i disable this behaviour? ...

How to refresh UITableView after app comes becomes active again?

I would like my UITableView to reloadData once my app is active again, after a user exits the application. I know I need to implement (in my app delegate): - (void)applicationDidBecomeActive:(UIApplication *)application but im not sure how to reference the current UITableView? UPDATE: My UITableView is a separate controller. It is a...

Changing the navigationbar color on the Edit screen of the More section

I am able to change the navbar color of the More navigationcontroller via: stTabBarController.moreNavigationController.navigationBar.tintColor = [UIColor colorWithRed:(102.0/255.0) green:(20.0/255.0) blue:(11.0/255.0) alpha:1]; but when I click the Edit button, the Configure screen appears and the navbar color is the default blue. How...

How do I center UIBarButtonItem with custom look?

Alright, so I have a TableView in one of my Views in my iPhone app. I'm using a UINavigationController, so using that I created the UIToolBar at the bottom of the table. Works great. However, I want the items in the toolbar to resemble how the Facebook app has them: Not only would I like the Buttons (I will have only 2) to resemble...

TTStyledTextLabel's url's font

Hey guys, in the TTStyledTextLabel, the url's font is a bit bigger(from what i noticed) and is blue-ish. I am just wondering how to change the url's font to a smaller size? ...

Clicking URL Link on TTStyledTextLabel doesn't push a new page

hey. When I am clicking URL link on TTStyleTextLabel, it doesn't push a new page. But when I looked at the TTCatalog, they don't have any method in the styledtexttestcontroller which seem to open up the webpage. So how does TTCatalog do that? How can I do that? ...

How to position view below green bar during phone call?

How do I make my view appear below the green bar during a phone call? right now my app is being partially covered by the green bar during a phone call. ...

Why doesnt my network activity icon appear in my iPhone app

Im using the standard: [NSURLConnection sendSynchronousRequest:theRequest returningResponse:&response error:&error]; method, but while the request is away, for both waiting for the response and downloading the data, the activity icon in the OS (very top) doesnt spin showing net...

present modal view controller

I am just getting started with iphone development I have a Tabbed application and I wanted to display a log in form modally so i looked here Apple Dev and did this inside one of my view controllers I connected a button to the following action: #import "LoginForm.h" ... -(IBAction)showLogin{ LoginForm *lf = [[LoginForm alloc]initWithNi...

Building libxslt for iPhone

I just had an app rejected for linking to libxslt using this technique. I'd really like to use XSLT in my app, so it looks like my only shot is to compile it myself. I don't want to use a UIWebView because I want to store the resulting HTML, not just display it. Has anyone done this -- compiled libxslt for the iPhone? After some Go...

Cocos2d Sprite not beeing added from another class

Hi, i'm having a little problem here and i cant figure out whats wrong. I have a simple setup. A CCLayer-subclass, in it's init-method I initialize a CCSpriteSheet and add it as child to the layer. - (id)init { ... enemySprites = [CCSpriteSheet spriteSheetWithFile:@"rock1.png"]; enemies = [[NSMutableDictionary alloc] init]; [self ad...

Examples of well coded cocoa iPhone apps on github

Hi Im looking for examples of well written Cocoa Touch iPhone apps to help me see what good cocoa code looks like. Specifically im interested in how people have layed out standard navigation apps. I am also interested in how different people have layed out the model/view/controller files as well as general naming conventions etc. Code...

Handling touches on Iphone

Im having a little problem on handling touches in my apps. I set my touchesBegan like this: - (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event { UITouch *currentTouch = [[event allTouches] anyObject]; touchPoint = [currentTouch locationInView:self.view]; if (CGRectContainsPoint(image1.frame, touchPoint)) { ...

UITextView inside UIScrollView scroll problem

Hi guys, I'm experiencing something considered a bug in my situation. Probably this is not a bug but a feature ;). Here's my case: I load a UIScrollView with my content. A part of my content is loaded asynchrone after the view is already loaded. This works great and without issue. Some of these controls however are UITextView controls...

NSFetchedResultsController section ordering

Hi everyone, I have a model like this one: I want to fetch the items in a grouped table view with the help of a NSFetchedResultsController where the Category.titles are the section titles, ordered with the help of Category.sortOrder. I tried to implement a compare- (which compares the sortOrder property) and description-method (whi...

Application crashes while adding photo adding new contact.

I am using ABNewPersonViewController to add new contact to the address book. Every thing is fine if I do not add any photo from photo albums. It crashes if I add any photo and here is the log:- NSInvalidArgumentException', reason: '*** -[NSCFDictionary setObject:forKey:]: attempt to insert nil value (key: UIImagePickerControllerOriginal...

Odd UITableView height behavior with NSZombieEnabled

I am setting my height: - (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath { CGFloat rowHeight = 0; if(indexPath.row == [self.items count]){ //more rowHeight = 50.0; //same as moreCell } else{ ChartlyCell *cell = (ChartlyCell*)[self tableView:tblView cellFo...

What happens if a UITableViewCell is not released?

What will happen if the autorelease is removed from cell creation in - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { STVCell *cell = (STVCell*)[tableView dequeueReusableCellWithIdentifier:CellIdentifier]; if (cell == nil) { cell = [[[STVCell alloc] initWi...

iPhone OS 3 SDK?

How can I install the iPhone OS 3 SDK beside the iOS 4 SDK? Is it possible? ...