objective-c

iPhone - subview stacking slowing down application?

Hi, As title says, I'm wondering if stacking subviews can slow down an iPhone application. For example, I have a UIViewController, which has a view occupying the whole screen. When the user presses a button, I create a second view controller and add its view as a subview of the original VC, making the second view completely hide the fi...

View wont update image(iphone app)

I have a simple UIView *myView which is set as follows myView.image = [UIImage imageNamed:[NSString stringWithFormat:@"%d.png", r]]; this takes the index r and gets that image, all works correctly in my two IBAction methods -(IBAction) previousImageSelector{ if (r != 0) r = r - 1; NSLog(@"r is%d",r); myView.image = [UIImage imag...

[iPhone] Analyzing NSZombie

I keep getting bad instruction or bad exception so I enabled NSZombieEnabled and the other vars needed, and I have no idea how to analyze the results. This is what was logged: ToDoWall(1634) malloc: recording malloc stacks to disk using standard recorder ToDoWall(1634) malloc: stack logging compaction turned off; size of log files on d...

Iphone application: Managing downloaded images

Hi I am currently trying to building a reader app for the iphone, a bit like NYTimes iphone app or Time magazine or USA today iphone app. Basically I'll be parsing a feed containing articles, saving the data locally in a database and displaying stuff and all that. Now I am just starting off with Iphone app development, I would just like...

UIImagePNGRepresentation in monochrome

I'm developing an iPod-touch app, using Objective C. I am trying to capture a drawing the user creates on the device. I am using UIImagePNGRepresentation to capture the data in PNG format. I want to change the PNG data: specifically I need to change it to a monochrome image. How do I go about changing its bit depth to 1? Regards, Br...

Locally stored files in application directory being randomly deleted on iPad, why?

My application on the iPad allows users to browse remote photos on their photo sharing site and optionally download whole albums of photos to the application's local directory (Documents) for offline viewing. I'm running into a problem where after a user has downloaded several (large) videos for offline viewing, they come back later and...

Dynamic UIViews in Obj-c + Cocoa touch

Hi guys, I need a way of creating a UIView dynamically. Thus, the parent class could look for say a count of array items, and create UIViews on the fly of the amount of items in the array. The views need to be allocated dynamically, do I can't create them on the fly. Can you help? ...

Remove Gray UITableView Scroll Bar

Hi, I am making an application with a UITableView that has a few sections (2), and when I run, the table view has this annoying gray scroll bar on the side, like the one in the "iPod" application, that has but 2 options in it. My question is, how do I hide the "scroll bar," because it is an unnecessary waste of space? Example: Code sn...

Objective-C: Any way to embed text formatting like < li>< /li> or < b>< /b> into a string in a plist?

I am a new objective-c/iPhone developer and am wondering if there is any way to embed formatting tags into a string in plist? I have a plist that is an array of dictionaries. Each dictionary contains a few string objects, some of which I would like to contain lists and paragraphs of information. Is there any way to embed tags like < ...

NSDate timeInterval = nil

I am trying to compare two NSDates one is created by the viewDidLoad method and the other by clicking a button. I want to be able to click the button and find the time difference since the viewDidLoad was ran. I keep getting a difference of nil. Any Ideas? #import "TimeViewController.h" id startTime; @implementation TimeViewControlle...

abort() called in gethostbyname - how to handle

I get a abort() which I am not able to 'catch' in my code. Perhaps I am missing some understanding; can you give me some insight or perhaps help me with the abort() ? Please note; the code works fine for thousands of users I have; but a very few (two now) have reported this crash. First the code (simplified): 244: -(void)openBSDSocket...

MPMoviePlayerController Move Playhead in <3.1 SDK

Hi everyone! I'm trying to write an app that will quickly move the playhead of a video based on touch events. Writing to the property currentPlaybackTime or calling seekToTime: on 3.2 and later works great, but I was wondering if there's a way to do this in 3.1? currentPlaybackTime and seekToTime were introduced in the MediaPlayback pro...

Matrix malloc Image Processing

Hello guys, I 'm trying to develop an Image Processing application for the images stored at the photo library of the iPhone, but to tell the truth I am confused. I'm interested in getting the A R G B matrixes out of the image. then make some algorithm with these matrixes and then releasing them. What would you prefer for the aforemention...

How to enable HTML client-side SQL database in embedded webkit app (test app on github)

I've got a super simple little OS X app with a minimal embedded webkit view that needs client-side SQL database support enabled. I've put the test app up on github but just can't get the client-side storage working. I'm using Xcode v3.2.3 with the WebKit framework it provides, but have also tried using the webkit nightly without luck. ...

AQGridView: Making a Selection

I am using AQGridView to build an iPad app that incorporates a flexible grid like that found in the Apple iBooks app or the Marvel and DC Comics apps. My question is has anyone used AQGridView and can help me with sheding some light on how to make a grid cell selection. It supposedly just makes a sub-class of UITableView but I can't seem...

Portable code for deprecated userInfo dictionary key (Cocoa)

In Mac OSX 10.6, the NSErrorFailingURLStringKey userInfo dictionary key is deprecated in favor of NSURLErrorFailingURLStringErrorKey. I am trying to write my program to be portable to both Mac OSX 10.5 and 10.6. For the time being, I'm just using the old key--but my compiler is giving me annoying deprecated warnings. // The following ca...

What are the differences between these two typedef styles in C?

I'm curious what the difference here is when typedefing an enum or struct. Is there any difference semantically between these two blocks? This: typedef enum { first, second, third } SomeEnum; and this: enum SomeEnum { first, second, third }; typedef enum SomeEnum SomeEnum; Same deal for structs. I've seen both in use, and they b...

Core Data Utility Tutorial - Sample Code

I am following apples Core Data Utility tutorial from http://developer.apple.com/mac/library/documentation/Cocoa/Conceptual/CoreDataUtilityTutorial/Articles/00_introduction.html I have only just started it and have already encountered an error (more than likely my error, not anyone else's). Given the code #import <Foundation/Foundati...

Alter CGRect (or any struct)?

I do this quite a bit in my code: self.sliderOne.frame = CGRectMake(newX, 0, self.sliderOne.frame.size.width, self.sliderOne.frame.size.height); Is there any way to avoid this tedious code? I have tried this type of thing: self.sliderOne.frame.origin.x = newX; but I get a Lvalue required as left operand of assignment er...

Extend NSMutableArray for bi-directional association management

I am a great fan of code generation (from UML) and coming from the Java world, I wonder how I would implement automated bi-directional association management in Objective-C. Image an association Partner <-> Address, one-to-many and navigable from both ends. What I would like to achieve is that if I append an Address to a Partner that Ad...