Search Results

Search found 372 results on 15 pages for 'uilabel'.

Page 5/15 | < Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • NSString problem on iphone while displaying on UILabel

    - by prajakta
    i have a issue , i am asking as new question as previoes one was messed NSString *s=@"hi\nhello\n\nwelcome to this world\ni m jhon" label.frame = ...//big enough height label.numberOfLines = 0; label.text = s; this code helps me to separate string based on \n but if i do this NSString *s=Ad.content //where Ad.content value is **hi\nhello\n\nwelcome to this world\ni m jhon** label.numberOfLines = 0; label.text = s; i am not able to sperate them by \n , what i am doing wrong here kindly suggest Thanks

    Read the article

  • Adding Emboss to a UILabel in a navigationItem.titleView (as seen with navigationItem.title)

    - by Sahil
    I'm trying to mimic the default emboss that automatically gets applied to navigationItem.title, as well as many other UIKit controls. As seen in this screenshot's title ("Table Cells"): I'm essentially trying to add 2 UILabels to the navigationItem.titleView, however the UILabels just show up as flatly drawn and it really just doesn't feel/look right :P I've thought about playing with shadows, but that would only give the embossed look (if even that) on one side of the label. Any ideas would be great! Thanks

    Read the article

  • UILabel not updating

    - by iFloh
    Sorry the basic question, but this bugs me for a while now. I create a details view from a UITable and try to dynamically set its labels, but they are not updating: - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { myObject *tmpObj = [[myObject objectAtIndex:indexPath.section] objectAtIndex:indexPath.row]; myViewController *tmpVC = [[myViewController alloc] initWithNibName:@"NIBfile" bundle:nil]; [tmpVC.myLabel setText:tmpObj.myTitle]; // The debugger shows the text: myTitle = "myText" NSLog(@"%@", tmpVC.myLabel); // NSLog SHOWS NULL [self.navigationController pushViewController:tmpVC animated:YES]; [tmpObj release]; } any ideas why the value is not coming through?

    Read the article

  • (iPhone SDK) How to link instance variables to a specific UILabel

    - by Timbo
    I'm using the iPhone SDK to build a simple application. I've created a brand new class which has a single variable. I need to make 5 instances of that class, which I have no trouble doing. I can create those instances and also set the variables without issue. What i do need to know is this: How do I link each of the 5 different instances of the variable to different and specific UILabels? Would I be better to create a method that dynamically creates and positions the labels? Thanks for your help in advance, I'm now to this iphone programming thing. I'm serious about learning fast though so I have posted a bounty on this question here : http://www.askearn.com/Responses.aspx?QuestionID=6542613f-7be8-4bb3-a950-aac218d47711

    Read the article

  • UILabel with custom font displays *wrong* custom font

    - by winsmith
    I'm using this method to embed custom fonts in my iPhone app. The embedding works: When I run the following code, the fonts are listed. (Currently, I'm embedding all family members of Myriad Pro in OTF format) for( NSString *familyName in [UIFont familyNames] ){ for( NSString *fntName in [UIFont fontNamesForFamilyName:familyName] ){ NSLog(@"%@", fntName); }} When I try to set the font of a label to MyriadPro or MyriadPro-Bold, this works just as expected. However, when I set the font to MyriadPro-BoldCond, the label is still set in MyriadPro-Bold instead of the condensed version. (The font names are correct, I checked.) My Code: [recommendationLabel setFont:[UIFont fontWithName:@"MyriadPro-BoldCond" size:140]]; recommendationLabel.adjustsFontSizeToFitWidth = YES; What's the deal?

    Read the article

  • how do we access values stored in NSMutableArray of NSMutableDictionary ?

    - by srikanth rongali
    I have stored values in NsMutableDictionaries . ThenI stored all the dictionaries in NSMutable Array. I need to access the values ? How can I do that ? -(void)viewDidLoad { [super viewDidLoad]; self.title = @"Library"; self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc] initWithTitle:@"Close" style:UIBarButtonItemStyleBordered target:self action:@selector(close:)]; cells = [[NSMutableArray alloc] initWithObjects:@"dict1", @"dict2", @"dict3", @"dict4", @"dict5", @"dict6", nil]; dict1 = [[NSMutableDictionary alloc] initWithObjectsAndKeys:@"Mon, 01 Feb #2", @"date", @"0.7", @"time", @"1.2MB", @"size", @"200*200", @"pix", nil]; dict2 = [[NSMutableDictionary alloc] initWithObjectsAndKeys:@"Wed, 02 Mar #3", @"date", @"1.2", @"time", @"2.2MB", @"size", @"300*300", @"pix", nil]; dict3 = [[NSMutableDictionary alloc] initWithObjectsAndKeys:@"Tue, 03 Apr #5", @"date", @"1.7", @"time", @"2.5MB", @"size", @"240*240", @"pix", nil]; dict4 = [[NSMutableDictionary alloc] initWithObjectsAndKeys:@"Mon, 01 Feb #2", @"date", @"0.7", @"time", @"1.2MB", @"size", @"200*200", @"pix", nil]; dict5 = [[NSMutableDictionary alloc] initWithObjectsAndKeys:@"Mon, 10 Nov #5", @"date", @"2.7", @"time", @"4.2MB", @"size", @"200*400", @"pix", nil]; dict6 = [[NSMutableDictionary alloc] initWithObjectsAndKeys:@"Mon, 11 Dec #6", @"date", @"4.7", @"time", @"2.2MB", @"size", @"500*200", @"pix", nil]; //[cells addObject:dict1]; //[cells addObject:dict2]; //[cells addObject:dict3]; //[cells addObject:dict4]; //[cells addObject:dict5]; //[cells addObject:dict6]; } // Customize the number of rows in the table view. - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { return [cells count]; } // Customize the appearance of table view cells. - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { static NSString *CellIdentifier = @"Cell"; UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier]; if (cell == nil) { cell = [[[UITableViewCell alloc] initWithFrame:CGRectZero reuseIdentifier:CellIdentifier] autorelease]; //cell.contentView.frame = CGRectMake(0.0f, 0.0f, 320.0f, 80.0f); [cell setAccessoryType:UITableViewCellAccessoryDisclosureIndicator]; UIImageView *image1 = [[UIImageView alloc]init]; image1.frame = CGRectMake(0.0f, 0.0f, 80.0f, 80.0f); image1.tag = tag7; UILabel *dateLabel = [[UILabel alloc]init]; dateLabel.frame = CGRectMake(100.0f, 5.0f, 120.0f, 25.0f); dateLabel.font = [UIFont fontWithName:@"Georgia" size:10]; dateLabel.tag = tag1; UILabel *timeLabel = [[UILabel alloc] init]; timeLabel.frame = CGRectMake(100.0f, 30.0f, 40.0f, 25.0f); timeLabel.font = [UIFont fontWithName:@"Georgia" size:10]; timeLabel.tag = tag2; UILabel *sizeLabel = [[UILabel alloc] init]; sizeLabel.frame = CGRectMake(160.0f, 30.0f, 40.0f, 25.0f); sizeLabel.font = [UIFont fontWithName:@"Georgia" size:10]; sizeLabel.tag = tag3; UILabel *pixLabel = [[UILabel alloc] init]; pixLabel.frame = CGRectMake(220.0f, 30.0f, 40.0f, 25.0f); pixLabel.font = [UIFont fontWithName:@"Georgia" size:10]; pixLabel.tag = tag4; UILabel *shareLabel = [[UILabel alloc] init]; shareLabel.frame = CGRectMake(100.0f, 55.0f, 100.0f, 25.0f); shareLabel.font = [UIFont fontWithName:@"Georgia" size:10]; shareLabel.tag = tag5; UILabel *deleteLabel = [[UILabel alloc] init]; deleteLabel.frame = CGRectMake(220.0f, 55.0f, 100.0f, 25.0f); deleteLabel.font = [UIFont fontWithName:@"Georgia" size:10]; deleteLabel.tag = tag6; [cell.contentView addSubview:dateLabel]; [cell.contentView addSubview:timeLabel]; [cell.contentView addSubview:sizeLabel]; [cell.contentView addSubview:pixLabel]; [cell.contentView addSubview:shareLabel]; [cell.contentView addSubview:deleteLabel]; [cell.contentView addSubview:image1]; [dateLabel release]; [timeLabel release]; [sizeLabel release]; [pixLabel release]; [shareLabel release]; [deleteLabel release]; [image1 release]; } // Set up the cell... [(UILabel *)[cell viewWithTag:tag1] setText:[cells objectAtIndex:[dict1 objectForKey: @"date"]]]; [(UILabel *)[cell viewWithTag:tag2] setText:[cells objectAtIndex:[dict1 objectForKey: @"time"]]]; [(UILabel *)[cell viewWithTag:tag3] setText:[cells objectAtIndex:[dict1 objectForKey: @"size"]]]; [(UILabel *)[cell viewWithTag:tag4] setText:[cells objectAtIndex:[dict1 objectForKey: @"pix"]]]; [(UILabel *)[cell viewWithTag:tag5] setText:@"Share"]; [(UILabel *)[cell viewWithTag:tag6] setText:@"Delete"]; cell.imageView.image = [UIImage imageNamed:@"image2.png"]; return cell; } - (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath { return 80.0f; } I did in above way but it is not working. I know the mistake is at the accessing values. but, I could not get how to do it ? Thank You.

    Read the article

  • bigger UITableViewCellStyleValue1 detailTextLabel

    - by Ziga Kranjec
    I am trying to make a UITableView. Table cells are done in style UITableViewCellStyleValue1. When text in either textLabel or detailTextLabel is too long, it gets shortened with ellipsis... This happens for both labels; the problem really occurs, when both labels are too long. What is a preferred way to disable this or make detailTextLabel slightly wider? I want detailTextLabel to always show the entire label (it will be max 6 chars long, so it will fit); textLabel is fine as it is.

    Read the article

  • "My account" or "Your account" labels

    - by Ferdy
    I have somewhat of a strange question that is not really technical, but I do hope to collect meaningful advice. I'm building a large web application, basically a photo sharing community site. As part of this site, logged-in users can go to their profile, from which they can see their own things (images, comments, votes) as well as edit their details and preferences. Users can also see profiles of others users (their images, comments, votes), but of course not edit their details. The question I have is simple but it keeps bothering me: What to call the personal links and content of a user? Should they be named "Your": Your images Your profile ... ...or "My": My images My profile ...or perhaps named, even if you're logged in: Fledder's images Fledder's profile As unimportant as it may sounds, I'm really looking for advice in this area. I'm particularly interested in any standards, why an option is preferred, and in which contexts it is preferred.

    Read the article

  • How do I update blackberry UI items from a thread?

    - by Andrei T. Ursan
    public class PlayText extends Thread { private int duration; private String text; private PlayerScreen playerscrn; public PlayText(String text, int duration) { this.duration = duration; this.text = text; this.playerscrn = (PlayerScreen)UiApplication.getUiApplication().getActiveScreen(); } public void run() { synchronized(UiApplication.getEventLock()) { try{ RichTextField text1player = new RichTextField(this.text, Field.NON_FOCUSABLE); playerscrn.add(text1player); playerscrn.invalidate(); Thread.sleep(this.duration); RichTextField text2player = new RichTextField("hahhaha", Field.NON_FOCUSABLE); playerscrn.add(text2player); playerscrn.invalidate(); Thread.sleep(1000); RichTextField text3player = new RichTextField("Done", Field.NON_FOCUSABLE); playerscrn.add(text3player); playerscrn.invalidate(); }catch(Exception e){ System.out.println("I HAVE AN ERROR"); } } } } With the above code I'm trying to create a small text player. Instead to get all the text labels one by one, something like display text1player wait this.duration milliseconds display text2player wait 1000 milliseconds display text3player thread done. The screens waits this.duration + 1000 milliseconds and displays all the labels at once. I tried with a runnable and calling .invokeLater or .invokeAndWait but I still get the same behavior, and even if I get dirty like above using synchronized it still doesn't work. Does anyone know how I can display each label at a time? Thank you!

    Read the article

  • Password authentication in sqlite3 for iphone

    - by user271753
    Hey Guys .. I am new to programming in Objective C . I checked many tutorials on reading data in sqlite3 , but almost all of them have show the data in UITableView . I have a page where the user types in the password, the password lets say 1234 is saved in the database ( I have created a table already ) . I have got the database into the project folder . I just want a statement like if(databasepassword == correct from the uitextfield ) { show next page } else { password is incorrect.text } I will figure out on how to show the next page and display the password is incorrect.text I just want a method to cross check with the password saved in the database . How can I do that ? Regards

    Read the article

  • Changing label color based on current label color in iPhone dev

    - by Matt Thomas
    I am having trouble figuring out the if statement code for changing the color of a UI label based on the current color of the label. For instance, if the label color is currently red and the correct button is pressed, I want the label color to change to black. If the label color is black I want the label color to change to blue. Many thanks for any tips.

    Read the article

  • iPhone: How to Display Underlined Text in a Button?

    - by Warrior
    I want to display the mail ID in my view such that clicking the mail ID should open the mail composer view. I want to display the button text as underlined to show it is a hyperlink and for the button click event to call the mail composer view. At present, I am not able to show the button text underlined. I thought of placing a label above the button and adjusting the label property to get the underlined text but that did not work. Is there a different way to get the appearance and behavior I want?

    Read the article

  • Need unicode characters in UITableView from SQLlite database

    - by Lee Armstrong
    I have some NSString varibales that incude items like Ð and Õ and if I do cell.textLabel.text = person.name; and if it contains one of those characters the cell.textlabel is blank! I have discovered that if I use NSString *col1 = [NSString stringWithUTF8String:(char *)sqlite3_column_text(compiledStatement, 0)]; To pull my data back it pulls back null, however using the deprectared method NSString *col1 = [NSString stringWithCString:(char *)sqlite3_column_text(compiledStatement, 0)]; Shows the characters! Any ideas?

    Read the article

  • How can I know the displayed text in the UILabelView?

    - by charly
    How can I know the displayed text in the UILabelView? I have a large text and I am going to have 3 uilabels that represent 3 columns of an iPad App like NYTimes one. When I put the large text in the first column (UILabelView) I need to know how much of the text is displayed there.. If U suggest another solution please let me know. Charly

    Read the article

  • Question about varrying top margin when using custom Fonts on the iPhone.

    - by user170030
    I am using FontLabel to display varying lengths of texts in a custom font. I size the FontLabel using the following : CGSize size = [myString sizeWithFont:[UIFont systemFontOfSize:[[[UIApplication sharedApplication] delegate] getFontSize]] constrainedToSize:CGSizeMake(290, 4000) lineBreakMode:UILineBreakModeWordWrap]; For some reason, this always presents a Fontlabel where the text starts at a different space from the top. Sometimes the text begins at the correct location. Other times, it appears either too high or too low. Would appreciate some help in how to solve this issue.

    Read the article

  • UIButton as a subview in UILable

    - by Jayshree
    hi. i am trying to dynamically add a UIbutton as a subview to UIlable. but i am not able to click the button. it seems that the lable doesnt allow the buttonTapped event to occur. can somebody explain what exactly is happening here. and can anybody give me an alternative for this. thnx

    Read the article

  • how do i let text fit to UIButton?

    - by iAsk
    problem: Button size is enough, however when I change title, the title text cannot fit the button width. Any SDK function can solve this problem, or I need to manually code to solve it? Please refer to following pictures. design in the nib file. initial show in simulator when I change the title text tried some ways before _button.titleLabel.adjustsFontSizeToFitWidth = YES; the way will change my font size. I cannot accept the way. [_button setTitleEdgeInsets:UIEdgeInsetsMake(10.0, 10.0, 0.0,0.0)]; the way change label's position only, not label size. [_button.titleLabel sizeToFit]; result is same with picture(3). [_button sizeToFit]; title moved to upper left corner, and the title still the same result. Just confused, my button size is big enough, why title size is so small?

    Read the article

  • Add UIView and UILabel to UICollectionViewCell. Then Segue based on clicked cell index

    - by JetSet
    I am new to collection views in Objective-C. Can anyone tell me why I can't see my UILabel embedded in the transparent UIView and the best way to resolve. I want to also segue from the cell to several various UIViewControllers based on the selected index cell. I am using GitHub project https://github.com/mayuur/MJParallaxCollectionView Overall, in MJRootViewController.m I wanted to add a UIView with a transparency and a UILabel with details of the cell from a array. MJCollectionViewCell.h // MJCollectionViewCell.h // RCCPeakableImageSample // // Created by Mayur on 4/1/14. // Copyright (c) 2014 RCCBox. All rights reserved. // #import <UIKit/UIKit.h> #define IMAGE_HEIGHT 200 #define IMAGE_OFFSET_SPEED 25 @interface MJCollectionViewCell : UICollectionViewCell /* image used in the cell which will be having the parallax effect */ @property (nonatomic, strong, readwrite) UIImage *image; /* Image will always animate according to the imageOffset provided. Higher the value means higher offset for the image */ @property (nonatomic, assign, readwrite) CGPoint imageOffset; //@property (nonatomic,readwrite) UILabel *textLabel; @property (weak, nonatomic) IBOutlet UILabel *textLabel; @property (nonatomic,readwrite) NSString *text; @property(nonatomic,readwrite) CGFloat x,y,width,height; @property (nonatomic,readwrite) NSInteger lineSpacing; @property (nonatomic, strong) IBOutlet UIView* overlayView; @end MJCollectionViewCell.m // // MJCollectionViewCell.m // RCCPeakableImageSample // // Created by Mayur on 4/1/14. // Copyright (c) 2014 RCCBox. All rights reserved. // #import "MJCollectionViewCell.h" @interface MJCollectionViewCell() @property (nonatomic, strong, readwrite) UIImageView *MJImageView; @end @implementation MJCollectionViewCell - (instancetype)initWithFrame:(CGRect)frame { self = [super initWithFrame:frame]; if (self) [self setupImageView]; return self; } - (id)initWithCoder:(NSCoder *)aDecoder { self = [super initWithCoder:aDecoder]; if (self) [self setupImageView]; return self; } /* // Only override drawRect: if you perform custom drawing. // An empty implementation adversely affects performance during animation. - (void)drawRect:(CGRect)rect { // Drawing code } */ #pragma mark - Setup Method - (void)setupImageView { // Clip subviews self.clipsToBounds = YES; // Add image subview self.MJImageView = [[UIImageView alloc] initWithFrame:CGRectMake(self.bounds.origin.x, self.bounds.origin.y, self.bounds.size.width, IMAGE_HEIGHT)]; self.MJImageView.backgroundColor = [UIColor redColor]; self.MJImageView.contentMode = UIViewContentModeScaleAspectFill; self.MJImageView.clipsToBounds = NO; [self addSubview:self.MJImageView]; } # pragma mark - Setters - (void)setImage:(UIImage *)image { // Store image self.MJImageView.image = image; // Update padding [self setImageOffset:self.imageOffset]; } - (void)setImageOffset:(CGPoint)imageOffset { // Store padding value _imageOffset = imageOffset; // Grow image view CGRect frame = self.MJImageView.bounds; CGRect offsetFrame = CGRectOffset(frame, _imageOffset.x, _imageOffset.y); self.MJImageView.frame = offsetFrame; } - (void)setText:(NSString *)text{ _text=text; if (!self.textLabel) { CGFloat realH=self.height*2/3-self.lineSpacing; CGFloat latoA=realH/3; // self.textLabel=[[UILabel alloc] initWithFrame:CGRectMake(10,latoA/2, self.width-20, realH)]; self.textLabel.layer.anchorPoint=CGPointMake(.5, .5); self.textLabel.font=[UIFont fontWithName:@"HelveticaNeue-ultralight" size:38]; self.textLabel.numberOfLines=3; self.textLabel.textColor=[UIColor whiteColor]; self.textLabel.shadowColor=[UIColor blackColor]; self.textLabel.shadowOffset=CGSizeMake(1, 1); self.textLabel.transform=CGAffineTransformMakeRotation(-(asin(latoA/(sqrt(self.width*self.width+latoA*latoA))))); [self addSubview:self.textLabel]; } self.textLabel.text=text; } @end MJViewController.h // // MJViewController.h // ParallaxImages // // Created by Mayur on 4/1/14. // Copyright (c) 2014 sky. All rights reserved. // #import <UIKit/UIKit.h> @interface MJRootViewController : UIViewController{ NSInteger choosed; } @end MJViewController.m // // MJViewController.m // ParallaxImages // // Created by Mayur on 4/1/14. // Copyright (c) 2014 sky. All rights reserved. // #import "MJRootViewController.h" #import "MJCollectionViewCell.h" @interface MJRootViewController () <UICollectionViewDataSource, UICollectionViewDelegate, UIScrollViewDelegate> @property (weak, nonatomic) IBOutlet UICollectionView *parallaxCollectionView; @property (nonatomic, strong) NSMutableArray* images; @end @implementation MJRootViewController - (void)viewDidLoad { [super viewDidLoad]; // Do any additional setup after loading the view, typically from a nib. //self.navigationController.navigationBarHidden=YES; // Fill image array with images NSUInteger index; for (index = 0; index < 14; ++index) { // Setup image name NSString *name = [NSString stringWithFormat:@"image%03ld.jpg", (unsigned long)index]; if(!self.images) self.images = [NSMutableArray arrayWithCapacity:0]; [self.images addObject:name]; } [self.parallaxCollectionView reloadData]; } - (void)didReceiveMemoryWarning { [super didReceiveMemoryWarning]; // Dispose of any resources that can be recreated. } #pragma mark - UICollectionViewDatasource Methods - (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section { return self.images.count; } - (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath { MJCollectionViewCell* cell = [collectionView dequeueReusableCellWithReuseIdentifier:@"MJCell" forIndexPath:indexPath]; //get image name and assign NSString* imageName = [self.images objectAtIndex:indexPath.item]; cell.image = [UIImage imageNamed:imageName]; //set offset accordingly CGFloat yOffset = ((self.parallaxCollectionView.contentOffset.y - cell.frame.origin.y) / IMAGE_HEIGHT) * IMAGE_OFFSET_SPEED; cell.imageOffset = CGPointMake(0.0f, yOffset); NSString *text; NSInteger index=choosed>=0 ? choosed : indexPath.row%5; switch (index) { case 0: text=@"I am the home cell..."; break; case 1: text=@"I am next..."; break; case 2: text=@"Cell 3..."; break; case 3: text=@"Cell 4..."; break; case 4: text=@"The last cell"; break; default: break; } cell.text=text; cell.overlayView.backgroundColor = [UIColor colorWithWhite:0.0f alpha:0.4f]; //cell.textLabel.text = @"Label showing"; cell.textLabel.font = [UIFont boldSystemFontOfSize:22.0f]; cell.textLabel.textColor = [UIColor whiteColor]; //This is another attempt to display the label by using tags. //UILabel* label = (UILabel*)[cell viewWithTag:1]; //label.text = @"Label works"; return cell; } #pragma mark - UIScrollViewdelegate methods - (void)scrollViewDidScroll:(UIScrollView *)scrollView { for(MJCollectionViewCell *view in self.parallaxCollectionView.visibleCells) { CGFloat yOffset = ((self.parallaxCollectionView.contentOffset.y - view.frame.origin.y) / IMAGE_HEIGHT) * IMAGE_OFFSET_SPEED; view.imageOffset = CGPointMake(0.0f, yOffset); } } @end

    Read the article

  • App is crashing as soon as UITableView gets reloaded

    - by OhhMee
    Hello, I'm developing an app where TableView needs to reload as soon as the login process gets completed. The app crashes with error EXC_BAD_ACCESS when the table data gets reloaded. It doesn't crash when I remove all case instances except case 0: What could be the reason behind it? Here's the code: - (void)viewDidLoad { [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(loginDone:) name:@"loginDone" object:nil]; statTableView.backgroundColor = [UIColor clearColor]; } - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger) section { return 6; } - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { static NSString *CellIdentifier = @"Cell"; UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier]; if (cell == nil) { cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier]; } // Configure the cell. switch (indexPath.row) { case 0 : cell.textLabel.text = @"Foo:"; NSLog(@"%@", data7); UILabel *myLabel2 = [[UILabel alloc] initWithFrame:CGRectMake(200, 10, 20, 30)]; myLabel2.text = (@"%@", data7); myLabel2.textColor = [UIColor blackColor]; myLabel2.backgroundColor = [UIColor whiteColor]; myLabel2.font = [UIFont fontWithName:@"Trebuchet MS" size:14]; [cell.contentView addSubview:myLabel2]; break; case 1: cell.textLabel.text = @"Foo: "; UILabel *myLabel4 = [[UILabel alloc] initWithFrame:CGRectMake(200, 10, 20, 30)]; myLabel4.text = (@"%@", data11); myLabel4.textColor = [UIColor blackColor]; myLabel4.backgroundColor = [UIColor whiteColor]; myLabel4.font = [UIFont fontWithName:@"Trebuchet MS" size:14]; [cell.contentView addSubview:myLabel4]; break; case 2: cell.textLabel.text = @"Foo: "; UILabel *myLabel8 = [[UILabel alloc] initWithFrame:CGRectMake(200, 10, 20, 30)]; myLabel8.text = (@"%@", data3); myLabel8.textColor = [UIColor blackColor]; myLabel8.backgroundColor = [UIColor whiteColor]; myLabel8.font = [UIFont fontWithName:@"Trebuchet MS" size:14]; [cell.contentView addSubview:myLabel8]; break; case 3: cell.textLabel.text = @"Foo: "; UILabel *myLabel10 = [[UILabel alloc] initWithFrame:CGRectMake(200, 10, 20, 30)]; myLabel10.text = [NSString stringWithFormat:@"%@", data4]; if ([data4 isEqualToString:@"0"]) { myLabel10.text = @"None"; } myLabel10.textColor = [UIColor blackColor]; myLabel10.backgroundColor = [UIColor whiteColor]; myLabel10.font = [UIFont fontWithName:@"Trebuchet MS" size:14]; [cell.contentView addSubview:myLabel10]; break; case 4: cell.textLabel.text = @"Foo: "; UILabel *myLabel12 = [[UILabel alloc] initWithFrame:CGRectMake(200, 10, 20, 30)]; myLabel12.text = [NSString stringWithFormat:@"%@", data5]; myLabel12.textColor = [UIColor blackColor]; if ([data5 isEqualToString:@"Foo"]) { myLabel12.textColor = [UIColor redColor]; myLabel12.text = @"Nil"; } myLabel12.backgroundColor = [UIColor whiteColor]; myLabel12.font = [UIFont fontWithName:@"Trebuchet MS" size:14]; [cell.contentView addSubview:myLabel12]; break; case 5: cell.textLabel.text = @"Foo: "; UILabel *myLabel14 = [[UILabel alloc] initWithFrame:CGRectMake(200, 10, 50, 30)]; if ([data6 isEqualToString:@"Foo"]) { myLabel14.textColor = [UIColor colorWithRed:(0/255.f) green:(100/255.f) blue:(0/255.f) alpha:1.0]; myLabel14.text = @"No Dues"; } else { myLabel14.text = [NSString stringWithFormat:@"%@", data6]; myLabel14.textColor = [UIColor redColor]; } myLabel14.backgroundColor = [UIColor whiteColor]; myLabel14.font = [UIFont fontWithName:@"Trebuchet MS" size:14]; [cell.contentView addSubview:myLabel14]; break; /* [myLabel2 release]; [myLabel4 release]; [myLabel8 release]; [myLabel10 release]; [myLabel12 release]; [myLabel14 release]; */ } return cell; }

    Read the article

< Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >