iphone

How to start movie playback at a certain frame or position in time, using MPMoviePlayerController?

The MPMediaPlayback protocol seems to not define any helpful method for this, and I couldn't find one in the MPMoviePlayerController. But I guess there IS a way to do it, because users must be able to drag the slider to some point in time when playing a movie. Yesterday I was reading a blog post that claimed the MPMovieController could ...

ASIHTTPRequest: check if username/password is correct

How can I check a webservice if the username/password is correct? I don't want to transfer the whole response body. I only want to know if the username/password exists and is correct. Currently I'm sending a request to my webservice like this: self.request = [ASIHTTPRequest requestWithURL:urlObject]; [self.request setUsername:username]...

handling events before back button is clicked

hi, Is there a way to find out whether the back button (Navigation bar) is clicked for a particular view ? if yes how ? ...

Drill-down application / Core Data+UITable View+Custom Cell

hi, i am currently working on a test project which has a tab bar, a drill down table list of Districts --> Schools --> school details. Data store is using core data/.mysqlite *Districts' view is a plain table list which list out districts **Schools' view is a table view with custom cell which display name,address and picture of school...

iPhone : Plain table issue. Cell background image not appearing

Hi there I have a some code that changes the background image of a cell which works perfectly in a grouped table view. However, does not in a plain table. Does anyone know why these behave differently? All I want to do is add a background image to a table cell (plain) This works perfectly on a grouped table view. Do I need a custom...

Iphone Core Data: Date Default Value as Current date

Hi, Im using Core data. I have an entity with an attribute of type Date. Is there a way I can set Default Values as Current Date? (Like entering 'CURRENTDATE' or something in default value of the attribute?) Thanks ...

iPhone draw with Core Graphics over an image

Hello, On my iPhone app, I would need to draw a kind of full gauge with a dynamic indicator. I was thinking of using a gauge image (a .png, that I would draw in an external tool) without any indicator, and then draw the dynamic indicator on top of the image. I was thinking of using a UIView with this image in background and then then us...

Best practices for using coding convention in companies

Hi (Objective-C and others) guys, I've a question, and I don't know if this is the best place to ask for it. Few days ago, dannywartnaby helped me with a problem I had and gave me an interesting advice, which can be considered as a coding convention, which is to prefix yout class files with your initials. I wonder if you know other bes...

ASIHTTPRequest: when does ASIAuthenticationDialog appear?

When does the authentication dialog appear? If I didn't set the username/password in the request or URL? ...

Where to put "extra" implementation?

Hi there. Occationaly I see snippets of code creating new methods for objects and such that looks like this: @implementation UIImage (Extras) - (void)aMethod:(id)anObject { // some functionality } @end Where do I put this code? Do I put it in the class I'm currently writing code for? If so at what point in the code do I need to p...

Date and time zone problems in Cocoa

I hav a string e.g. 2010-09-24. Now I want this string read as it is in an other timezone as I am. So I create an NSDateFormatter and set it's time zone e.g. to Europe/Berlin. What I get back is an NSDate object adjusted (2010-09-23 18:00:00) to my local time zone (e.g. America/New_York). But I want an NSDate in the time zone Europe/Be...

iphone - long tap firing two times the same method

I have a UIView custom class and the object created by this class has a long gesture recognizer, added as this UILongPressGestureRecognizer *tapAndHold = [[UILongPressGestureRecognizer alloc] initWithTarget:self action:@selector(doStuff:)]; [tapAndHold setDelegate:self]; ...

UISwitch in a UITableView cell

How can I embed a UISwitch on a UITableView cell? Examples can be seen in the settings menu. My current solution: UISwitch *mySwitch = [[[UISwitch alloc] init] autorelease]; cell.accessoryView = mySwitch; ...

How to properly shut down/restart NSThread after applicationDidEnterBackground/applicationWillEnterForeground

For performance reasons, I instantiate a dedicated NSThread to process incoming messages that are streamed from a network server. I use an NSOperation for the purpose of instantiating the connection and receiving incoming data through the NSURLConnection delegates, but as soon as new data comes in and gets parsed, I offload the processi...

How can I render different paragraph styles in Core Text?

Hi, I'm having a difficult time trying to work out how to build a page using Core Text, where I have multiple paragraphs which follow one another, but in different styles. In other words, I would like to have a title paragraph, followed by a subtitle paragraph, followed by several body paragraphs. In HTML terms, this would be: <h1>Som...

repeat an image when scrolling on iphone

Hi, i've got an UIImageView, now i want to repeat this image, that it always shows up again when scrolling left or right. Little Example: is this possible? it should feel like an infinite loop ...

asking if user wants to use Location Services

How does the process of "asking if user wants to use Location Services" work? I read here that a dialog at the installation appears, which asks the user if Location Services should be allowed or not. Does it mean that there is nothing to do for the developer, because the user can change this behavior in settings? So there is no "asking ...

Do I need to create variables and link IBOutlet for every UIVIew?

I have a View Controller that is swapping UIView objects in and out. There is the potential to have hundreds of different views, each with their own behaviors. Within my current MainWindow.xib file I currently have: File's Owner UIApplication First Responder UIResponder AppDelegate AppDelegate -Cover Cover Window...

iPhone: calling a parent/super method from a subview

hope someone can help me on this as been stuck for hours. I am trying to make a kind of picture book. I have a view which is my container and I add subviews to that by using addsubview. On the subview, I have swipe gestures etc that I want to trigger off method in the parent view. I worked out how to trigger the delegate but I cant get...

Transparency between UITableViewCells

Hi! I want to have transparency between UITableViewCells. Space between the cells. I user custom created cells and for setting a background i use this code: - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { static NSString *CustomCell = @"CustomBookingCell"; currentBooki...