Simply, I have placed an image with the Interface Builder in a UIView. Now I want to run a method/function when I am touching that image, for example when another image should be loaded.
My Code:
- (void)touchesended:(NSSet*) touches withEvent:(UIEvent *)event {
// UITouch *touch = [touch anyObject];
bild_1_1.image = [UIImage...
I want to write a small bit of data from my app to the iphone so I can load it when the app next starts. I am going to write the data using NSCoding, but I don't know what I should be specifying as a path. I understand I would write the data to the application sandbox, just not sure how to specify that.
gary
...
I've already found how to capitalize all words of the sentence, but not the first word only.
NSString *txt =@"hi my friends!"
[txt capitalizedString];
I don't want to change to lower case and capitalize the first char. I'd like to capitalize the first word only without change the others.
...
I'm trying to add a tableview to a view in code instead of using Interface Builder and unfortunately it's causing some problems =(
Here's an example of how I'm doing it now.
NSScrollView *scrollView = [[NSScrollView alloc] initWithFrame:someRect];
NSTableView *tableView = [[NSTableView alloc] initWithFrame: scrollView.bounds];
resultsT...
Hi
i am new in iphone i am using sqlite3 database. and I am retrieve value from database into table view. when we insert new data into database this is show in the table view but this is not inserted database table. i am not able to find out where this value store.
plz tell me
...
I am looking to save some settings when my application exits and I am a little confused about the 2 different versions below. My feeling is that to better fit the MVC pattern I should be using the version in the viewController. I am just curious as most folks don't seem to do much in the appDelegate when that call would be used?
AppDele...
Hello, i have another (probably unanswered) question about map views. I have a map view inside a table view cell and i want to disable the table view scrolling if the scrolling begins in the map view. Also the zooming gesture does not function normally. It only functions if the zooming gesture is done horizontally on the iphone display. ...
HI Guys,
Here I am having a problem In encoding/decoding the strings.
Actually I had a string which I am encoding it using the base64.which was working fine.
And now I need to decode the string that was encoded before and want to print it.
I code I written as:
I imported the base64.h and base64.m files into my application which con...
I am having code
NSString *cellValue1 = [products1 objectAtIndex:indexPath.row];
when i try to print NSLog(@"cell value is %@",cellValue1);
in log i am not getting anything,
if i use %s, i am getting some symbols, not the string located in cellValue1.
Please help me.
Thanks in advance.
...
I have the following base/derived class setup in Objective-C:
@interface ASCIICodeBase : NSObject {
@protected
char code_[4];
}
- (Base *)initWithASCIICode:(const char *)code;
@end
@implementation ASCIICodeBase
- (ASCIICodeBase *)initWithCode:(const char *)code len:(size_t)len {
if (len == 0 || len > 3) {
return nil;
}
if ...
Hi all,
I have a view controller that manage a view with a table view, a toolbar, a navigation bar and so on.
Inside the toolbar, I have a GPS signal indicator. It is composed of a number of bars with different heights, different colors, and so on depending on signal quality.
The GPS signal indicator is a complex (sub)view that I want...
Quick question, my data model is a singleton object and it contains a list of names that I want to archive. My idea is to make the model responsible for loading and saving it's own data. The model's load method will be called by the ViewController's viewDidLoad method and save by the ViewController's applicationWillTerminate. I could do ...
Hi,
I'm having a fundamental issue with use of drawRect: Any advice would be greatly appreciated.
The application needs to draw a variety of .png images at different times, sometimes with animation, sometimes without.
A design goal that I was hoping to adhere to is to have the code inside drawRect: very simple and "dumb" - i.e. just do...
I know you use the C based networking API to do FTP communication but I'd prefer to use something a little higher level. I've seen a few Objective-C based wrappers but I'm not sure what to use. I don't need that complex of FTP interaction. Its just the typical create/delete dirs, upload/download files... What do you recommend?
Edit:
Her...
I have this memory leak that has been very stubborn for the past week or so. I have a class method I use in a class called "ArchiveManager" that will unarchive a specific .dat file for me, and return an array with it's contents. Here is the method:
+(NSMutableArray *)unarchiveCustomObject
{
NSMutableArray *array = [NSMutableArray a...
Please help a TOTAL beginner.!
I found this post: http://stackoverflow.com/questions/56648/whats-the-best-way-to-shuffle-an-nsmutablearray
And as i try to deploy this in my own code, I cant get it working... :-(
Can anyone help me to resolve this code?
To me it looks like the shuffle function is not called..?
here is my code:
// //...
I created a TTModelViewController. in the createModel Method i created a TTURLRequestModel. after Loading content in the TTURLRequestModel i want to call a method in my TTModelViewController.
TTModelViewController
- (void) createModel {
requestModel = [[singlePostModel alloc] initWithId:@"54"];
}
- (void)didLoadModel:(BOOL)firstT...
Hi, I have a newbie question regarding when to release the elements of a NSArray. See following pseudo code:
NSMutalbeArray *2DArray = [[NSMutableArray alloc] initWithCapacity:10];
for (int i=0;i<10;i++) {
NSMutableArray *array = [[NSMutableArray alloc] initWithCapacity:5];
for (int j=0;j<5;j++) {
MyObject *obj = [[MyObject allo...
I would like to determine what the long url of a short url is. I have tried using http HEAD requests, but very few of the returned header fields actually contain any data pertaining to the destination/long url.
Is there:
1. Any way to determine the long url?
2. If so, can it be done without downloading the body of the destination?
Tha...
In this code I am loading a View Controller (and associated View) from a .xib:
-(id)initWithCoder:(NSCoder *)coder
{
[super initWithCoder:coder];
return self;
}
This successfully works, but I do not really understand what the line [super initWithCoder:coder] is accomplishing. Is that initializing my View Controller after my Vi...