Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7442639
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T11:12:24+00:00 2026-05-29T11:12:24+00:00

How to add the String value to the UIImage in xcode,iphone .The code shown

  • 0

How to add the String value to the UIImage in xcode,iphone .The code shown represents the images to be inserted in an array.If i run this code,the list of images to be displayed on the screen and if i tap any one image among the list of images must shown to a full screen.Am new to iphone ,I hope some one help me out with this problem .when appending the second image to the block,retrieving null value

    NSMutableArray *images = [[NSMutableArray alloc] init];

    [images addObject:@"item1.jpg"];
    [images addObject:@"item2.jpg"];
    [images addObject:@"item3.jpg"];
    [images addObject:@"item4.jpg"];
    [images addObject:@"item5.jpg"];
    [images addObject:@"item6.jpg"];
    [images addObject:@"item7.jpg"];
    [images addObject:@"item8.jpg"];
    [images addObject:@"item9.jpg"];

    for (int y = 0; y < rows; y++) {
        for (int x = 0; x < columns; x++) {
            CGPoint blockOrigin = CGPointMake(x * blockSize.width, y * blockSize.height);
            CGRect blockFrame;
            blockFrame.size = blockSize;
            blockFrame.origin = blockOrigin;
            NSString *imagename=[[NSString alloc]init];
            imagename=[images objectAtIndex:k];

            NSLog(@"image is :::%@",imagename);

            //  UIImage *blockimg=[[UIImage alloc]init ];

            UIImage * blockImage = [UIImage imageNamed:[images objectAtIndex:k]];

            NSLog(@"block image is %@",blockimg);
            TouchImageView * tiv = [[TouchImageView alloc] initWithFrame:blockFrame];
            [[tiv internal] setImage:blockimg];
            [self.view addSubview:[tiv autorelease]];
            k=k+1;
        }
    }

Here image is not added to the blockImage.Please give me solution for this.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-29T11:12:25+00:00Added an answer on May 29, 2026 at 11:12 am

    use this , please use NSArray

      NSArray *images = [NSArray arrayWithObjects:[UIImage imageNamed:@"item1.jpg"], 
                                     [UIImage imageNamed:@"item1.jpg"],
                                 [UIImage imageNamed:@"item1.jpg"],
                                 [UIImage imageNamed:@"item1.jpg"], 
                                 [UIImage imageNamed:@"item1.jpg"],
                                 [UIImage imageNamed:@"item1.jpg"], 
                                 [UIImage imageNamed:@"item1.jpg"],nil];
    

    and remove this code

    NSString *imagename=[[NSString alloc]init];
                imagename=[images objectAtIndex:k];
    NSLog(@"image is :::%@",imagename);
    

    and again check with breakpoint

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In my code I have this everywhere command.Parameters.Add(@name, DbType.String).Value = name; Is there an
Let's say I've got: Dim los1 as New List(Of String) los1.Add(Some value) Dim los2
public List<string> Attributes = new List<string>(); public void Add(string key, string value) { if
You can refer to this post of mine. WebControl.Attributes.Add(string key, string value); This is
Let's suppose I have this piece of code. foreach(string value in myList) { string
When I add a string value into an array through array_push() , it gives
Its simple to add items into this cache: HttpContext.Current.Cache.Add( string key, Object value, CacheDependency
I have a list of string values that I want add to a hashtable
if i add string in a TextView for example, this is my string and
The error is this: The method add(String, int) in the type DataNode is not

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.