10:20 AM

Code Signing !! deployment of iapps

Posted by pradeep T

CodeSign error: a valid provisioning profile is required for product type ‘Application’ in SDK ‘Device - iPhone OS 2.2″
This error will appear when you update your provisioning profile in iPhone SDK 2.2
or after the expiration of developer certificate and that you have a new provisioning profile from the developer portal
This is the solution (which is modified from http://www.furmanek.net/54/iphone-sdk-22-codesign-error/)
Suppose you have copied your provisioning profile called “iPhone_Development.mobileprovision” to the Library folder and build & go an old iPhone project called “MyApp”, and this annoying error appears
(1) cd ~/Library/MobileDevice/Provisioning\ Profiles/
(2) find out the UUID of the provisioning profile
strings iPhone_Development.mobileprovision | grep ".*-.*"
output is like this
xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
(3) copy that UUID between the string tag
(4) close xcode and go to your project
cd ~/Projects/MyApp/MyApp.xcodeproj
(5) Use a text editor to open the project.pbxproj
find the string PROVISIONING_PROFILE
paste the UUID that you copied from step (3) and put it in both Debug and Release Sections (do multiple finds) for the following line
e.g.
PROVISIONING_PROFILE = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx";
(6) Launch XCode and open the project and build & go again




This seems to be a chronic issue and is unresolved across many forums. This error occurs when you Build and Go for Device - iPhone OS 2.1 and can be verified when looking under Project Info > Build > Code Signing > Code Signing Provisioning Profile > Any iPhone Device, the name of your Provisioning Profile (ie. ITP DAP Projects) will not be listed as a Value.
I was able to resolve this issue by restoring my iPhone in Xcode under the Summary tab of the Organizer window.
Before doing so, you should of course confirm you have the Development Certificate and WWDR Intermediate Certificate in place, and have the Provisioning Profile both on your Mac under Library > MobileDevice > Provisioning Profile and on your iPhone under Settings > General > Profile

10:17 AM

UseFull Links !!

Posted by pradeep T

Blogs :
http://iappdevs.com/
http://www.iphonedevforums.com/
http://www.iphonesdkarticles.com/2008/11/parsing-xml-files.html
http://www.idevgames.com/forum/showthread.php?t=16500
http://forums.macrumors.com/showthread.php?t=629384
http://discussions.apple.com/message.jspa?messageID=7520321
http://stackoverflow.com/questions/121615/how-to-tint-a-uibutton
http://www.iphonedevsdk.com/forum/
http://www.fifthfloormedia.com/iphone-tutorial-animation-demo-1/

Mac :
http://hci.rwth-aachen.de/cocoaheads
http://stefan.hafeneger.name/2008/06/03/iphone-datamatrix-reader/
http://iphone.trac.wordpress.org/browser

coreGraphics !! buton gradient

http://cocoawithlove.com/2008/09/drawing-gloss-gradients-in-coregraphics.html

article on XML PARSING:

http://www.iphonesdkarticles.com/2008/11/parsing-xml-files.html



Codes:
http://blog.coriolis.ch/2008/11/09/add-an-uiprogressview-or-uiactivityindicatorview-to-your-uialertview/
http://www.ipodtouchfans.com/forums/showthread.php?t=102782

Sample Codes:
http://code.google.com/p/cookbooksamples/downloads/list



Topic Wise:

10:06 AM

NSArray and Sorting

Posted by pradeep T

Array declaration !!

NSArray *theSimpsons = [[NSArray arrayWithObjects:
@"Homer Jay Simpson", @"Marjorie "Marge" Simpson",
@"Bartholomew "Bart" J. Simpson", @"Lisa Marie Simpson",
@"Margaret "Maggie" Simpson",
@"Abraham J. Simpson",
@"Santa's Little Helper",
@"Ned Flanders", @"Apu Nahasapeemapetilon",
@"Clancy Wiggum", @"Charles Montgomery Burns",nil] retain];


NSArray *myarray=[NSArray arrayWithObjects:@"32", @"54",@"1", nil];
NSArray *sortedArray= [myarray sortedArrayUsingFunction:intSort context:NULL];
NSLog(@"%@",sortedArray);
}

NSInteger intSort(id num1, id num2,void *context)
{
int v1=[num1 intValue];
int v2=[num2 intValue];
if(v1<v2)
return NSOrderedAscending;
else if (v1>v2)
return NSOrderedDescending;
else
return NSOrderedSame;
}

10:01 AM

UIPickerView !!

Posted by pradeep T

#import

@interface StartUpViewController : UIViewController {
UIPickerView *accuracyPicker;
NSArray *pickerItems;
}
@property(nonatomic,retain)UIPickerView *accuracyPicker;
@end

- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil {
if (self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]) {
pickerItems = [[NSArray alloc] initWithObjects:@"Best",@"10 \t KMS",@"20 \t KMS",@"30 \t KMS",@"40 \t KMS",nil];

}
return self;
}



// returns the number of columns to display.
- (NSInteger)numberOfComponentsInPickerView:(UIPickerView *)pickerView
{
return 1;
}

// returns the number of rows
- (NSInteger)pickerView:(UIPickerView *)pickerView numberOfRowsInComponent:(NSInteger)component
{
return [pickerItems count];
}

#pragma mark ---- UIPickerViewDelegate delegate methods ----

// returns the title of each row
- (NSString *)pickerView:(UIPickerView *)pickerView titleForRow:(NSInteger)row forComponent:(NSInteger)component
{
NSString *currentItem = [pickerItems objectAtIndex:row];
return currentItem ;
}

// gets called when the user settles on a row
- (void)pickerView:(UIPickerView *)pickerView didSelectRow:(NSInteger)row inComponent:(NSInteger)component
{

NSString *currentItem = [pickerItems objectAtIndex:row];
printf("\n Accuracy set :%s",[currentItem UTF8String]);
}


- (void)viewDidLoad {
[super viewDidLoad];
UIView *mview = [[UIView alloc] initWithFrame:[[UIScreen mainScreen] applicationFrame]];
//[[UIScreen mainScreen] applicationFrame] this fits the view frame to complete secreen
accuracyPicker = [[UIPickerView alloc] initWithFrame:CGRectMake(0, 75, 100, 100)];
//creating the picker view
accuracyPicker.autoresizingMask = UIViewAutoresizingFlexibleWidth;
accuracyPicker.delegate = self;
accuracyPicker.dataSource = self;
accuracyPicker.showsSelectionIndicator=YES;//for showing the picker
mview.backgroundColor=[UIColor darkGrayColor];//for the background color
[mview addSubview:accuracyPicker];

self.title =@"Welcome to Hotels App";
self.view = mview;
[mview release];

}

9:58 AM

UITableView -iphone

Posted by pradeep T

this is an article about table view!!

MAKING table view GROUPED ::

tb = [[UITableView alloc] initWithFrame:[[UIScreen mainScreen] applicationFrame] style:UITableViewStyleGrouped];

************

UITableView *tableView = [[UITableView alloc] initWithFrame:CGRectMake(0,0,320,440) style:UITableViewStyleGrouped];
tableView.rowHeight = 55;
[tableView setSectionHeaderHeight:5];
[tableView setSectionFooterHeight:5];

2. Setting with Delegate methods.
_______________________________________________________
- (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section
{
return 25.0f;
}
- (CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section
{
return 25.0f;
}
Setting with properties
___________________________________________________________
UITableView *theTableView = [[UITableView alloc] initWithFrame:CGRectMake(0, 0, 320, 440) style:UITableViewStyleGrouped];
theTableView.delegate = self;
theTableView.dataSource = self;
theTableView.backgroundColor=[UIColor brownColor];
UIImageView *img=[[UIImageView alloc]initWithImage:[UIImage imageNamed:@"flag_green(2).png"]];
img.frame=CGRectMake(5, 10, 5, 5);
[theTableView setTableHeaderView:img]

2. Setting with Delegate methods.
_______________________________________________________
- (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section // custom view for header. will be adjusted to default or specified header height
{
UIImageView *img=[[UIImageView alloc]initWithImage:myimageview];
img.frame=CGRectMake(5, 10, 10, 10);
return img;
}
- (UIView *)tableView:(UITableView *)tableView viewForFooterInSection:(NSInteger)section // custom view for footer. will be adjusted to default or specified footer height
{
UIImageView *img=[[UIImageView alloc]initWithImage:myimageview];
img.frame=CGRectMake(5, 10, 10, 10);
return img;
}

9:51 AM

UIView !!

Posted by pradeep T

This blog contains details about UIView !!


- (void)applicationDidFinishLaunching: (UIApplication *)application {

UIButton *myButton= [[UIButton alloc] init];
myButton = [[UIButton buttonWithType:UIButtonTypeRoundedRect] retain];
myButton.frame = CGRectMake(105,180, 115, 35);
[myButton setTitle:@"Apply Image" forState:UIControlStateNormal];
myButton.backgroundColor = [UIColor clearColor];
[myButton addTarget:self action:@selector(ApplyImage: ) forControlEvents:UIControlEventTouchUpInside];

[window addSubview:myButton];//So Here we keeping a button on windowthe button action is ApplyImage() methos calling
[window makeKeyAndVisible];
[myButton release];
}

-(void)ApplyImage:(id)sender
{
UIView *mview= [[UIView alloc] initWithFrame:[[UIScreen mainScreen] applicationFrame]];

UIImageView *img=[[UIImageView alloc]initWithImage:[UIImage imageNamed:@"fantasy_13.jpg"]];
img.frame=CGRectMake(0, 0, img.frame.size.width, img.frame.size.height);
[mview addSubview:img];
[img release];

UILabel *name = [[UILabel alloc]initWithFrame:CGRectMake(105,180,250,25)];
name.text = @"This is my View Example";
name.textColor=[UIColor whiteColor];
name.font=[UIFont boldSystemFontOfSize:13];
name.backgroundColor=[UIColor clearColor];
[mview addSubview:name];
[name release];

[window addSubview:mview];
[mview release];
}

9:43 AM

UIbutton !! complete details

Posted by pradeep T

Hi everyone !! this is a new thread  I am starting ...... its a blog which contains iphone coding !! I have created this as a reference for myself in my development work and also help people who are new to iphone !! 



UIButton *myButton= [[UIButton buttonWithType:UIButtonTypeRoundedRect] retain];
myButton.frame = CGRectMake(105,180, 115, 35);
[myButton setTitle:@"Apply Image" forState:UIControlStateNormal];
myButton.backgroundColor = [UIColor clearColor];
[myButton addTarget:self action:@selector(ApplyImage: ) forControlEvents:UIControlEventTouchUpInside];