objective-c

UIWebView loaded from another class, where to put delegate methods?

Hey. I'm loading in a UIWebView from another class, and that works great. But now I need to know how I can implement these delegate methods: - (BOOL)webView:(UIWebView *)webView shouldStartLoadWithRequest:(NSURLRequest *)request navigationType:(UIWebViewNavigationType)navigationType // AND: - (void)alertView:(UIAlertView *)alertView c...

Interface Builder + Sprite Strips

Hello, I'm in the midst of porting a win32 app to cocoa. Wherever possible, I'm using IB, since... well its way easier in every way possible, obviously. One thing is the designer and the win32 dev set up all the button assets on a massive "sprite sheet" such you move around the viewport to determine button state. Similar to how yahoo do...

Can I block on a Spotlight NSMetadataQuery?

I have created an NSMetadataQuery to search for all audio available through Spotlight, modelled on the following command, which returns plenty of results: mdfind kMDItemContentTypeTree == "public.audio" Here is the code I'm using: NSMetadataQuery * q = [[[NSMetadataQuery alloc] init] autorelease]; [q setPredicate:[NSPredicate predicate...

iphone: How can I remove the red colors from an image? (RGB colors)

Let's say I have an UIImageView, and I wanna show only blue and green colore from it, (RGB colors). Like in Photoshop, I can choose what colors to show, red, blue, and green, so in the image to delete the red color. So how can I do it? I really new in Objective-c and all :) ...

nonatomic property in model class when using NSOperationQueue (iPhone)?

I have a custom model class with an NSMutableData ivar that will be accessed by custom NSOperation subclasses (using an NSOperationQueue). I think I can guarantee thread-safe access to the ivar from multiple NSOperations by using dependencies, and I can guarantee that I don't access the ivar from other code (say my main app thread) by ...

How to erase part of an image as the user touches it

My big picture goal is to have a grey field over an image, and then as the user rubs on that grey field, it reveals the image underneath. Basically like a lottery scratcher card. I've done a bunch of searching through the docs, as well as this site, but can't find the solution. The following is just a proof of concept to test "erasing...

Writing an app to stream video to iPhone

I'm interested in creating an iPhone app that can stream video from a central server, YouTube style. I was wondering if anyone has ever tried to do this before, what is the path of least resistant, existing APIs, etc? I really know nothing about how this is generally done. Would I be working with sockets? Just looking for some direction ...

InAppSettingsKit without saving to Settings app

I've seen there is a library called InAppSettingsKit - http://www.inappsettingskit.com/ - which lets your in-app settings mimic your settings within the Settings app. But is there a way to get this to NOT use the Settings app as well? So it just allows you to change settings within the app. Or is there another library which does this...

A simple way to implement pathfinding using bullet physics - iPhone SDK

Hi, I have bullet physics set up and working on the iPhone but now I want to implement some sort of path finding with it. The problem is I have no idea where to start, the level is pretty simple just a lot of pillars that I want the 'bad guys' to navigate around to get to the player character. Do you have any suggestions or are there ...

noob with unrecognized selector woes

I'm puzzled... I have this function "colorWithHexString"... when I include it in the viewcontroller that's calling it then it works fine. But when I move it to a separate "BSJax" class and call it with the same input parameter it throws an unrecognized selector error. Here's the call: BSjax *bsjax = [BSjax new]; NSString *hexString = ...

CGFloat vs GLfloat

I understand CGFloat should be used in Cocoa applications to make them 64-bit clean. But what about in a simple OpenGL game that uses Cocoa/Objective-C for everything but the rendering (to an NSOpenGLView)? CGFloat is a part of Core Graphics, so if I would it also be alright to use CGPoint, CGRect etc.? or should I just write rects and v...

I'm 532 hours away from GMT????

iPhone, Xcode, Objective-c: NSDateFormatter *df = [[[NSDateFormatter alloc] init] autorelease]; [df setDateFormat:@"yyyy-MM-dd HH:mm:ss"]; NSString *s = @"1902-02-01 01:00:00"; NSDate *aDate = [df dateFromString:s]; NSLog(@"(%@)", aDate); // (1902-02-01 01:00:00 -053211) Wow.. 532 hour timezone offset? ...

How to create a dynamic page in iPhone

Hi All, I want to use a page in our xib which is change every month,This page contain text,song,and image. Please tell me how i perform this,I think i put my song,image,and text file on the server and change every month song,image and text on the server which is automatically changed in our application. If i am right then suggest me h...

Releasing dynamically added UILabel.

I am adding a no. of UILable dynamically to my view like this UILabel *test = [[UILabel alloc] initWithFrame:CGRectMake(x, y, 50, 50)]; [self.view addSubview:tick]; Is it necessary to release these UILabel from memory in viewDidUnLoad and dealloc, if yes how i will release them? how i will get their reference? ...

Retrieve purchased information in In-App purchase

I have created in-app purchase for non-consumable object application in iPhone using with store kit its properly working, but i am not getting that from which function information about product is checked that product is purchased or not. please help me out thnx Kunal ...

sqlite3 - stringWithUTF8String is leaking!

I would appreciate if someone could help me solve my leaking problem. The leaks occur at: aImage, aCategory, aDescription, category and categories. I release them in dealloc, but obviously that is not sufficient: -(void) readListFromDatabase:(char *) sqlStatement { // Setup some globals databaseName = @"mydatabase.sql"; // ...

Reloading the model of a TTTableViewController

My problem is that I have a Register Controller and a Login Controller. The Login Screen displays a Login Screen or a Logout Screen depending if a user is logged in. Now when a user registers, does not close the app, and then goes to the Login Screen it will still display a Login Screen, although there is a logged in user already. This i...

Three20 URLNavigation: Disabling view persistence for some controllers

I generally like the View Persistor in the Three20 URLNavigation, however, I would like to exclude a few Controllers so they can't be the the first controller to show when the app loads. how can i do that? ...

solution for different tab bars in other screen

Hi Guys I am finding the solution for my application. I create an iphone application have 3 screen: First screen not contain any tab bar. Second screen have 2 tab bar item. Third screen have 3 tab bar item. http://c.upanh.com/upload/7/719/L50.11932623_1_1.jpg If i create a UITabBarController -> the tab bar will be appeared from first...

Could InAppSettingsKit do this, or is there another library?

I'm trying to implement a system whereby the user is initially presented with a single tablecell, in a uitableview (grouped style), within a uinavigationview. --------------- + | add record | --------------- When they click on the cell, they are pushed onto a new screen where they fill in a few textviews (perhaps imbedded in a ta...