小编kin*_*ton的帖子

将图像存储在数组中

我正在尝试将我的图像存储在名为"_images"的数组中,但如果我NSLog()用来查看存储在图像数组中的数据,我只会得到一个图像.你能帮助我吗?这是我的代码:

_images =[NSMutableArray arrayWithObject:[UIImage imageNamed:@"logo1.png"]];
_images =[NSMutableArray arrayWithObject:[UIImage imageNamed:@"logo2.png"]];
_images =[NSMutableArray arrayWithObject:[UIImage imageNamed:@"logo3.png"]];
_images =[NSMutableArray arrayWithObject:[UIImage imageNamed:@"logo4.png"]];
_images =[NSMutableArray arrayWithObject:[UIImage imageNamed:@"logo5.png"]];
_images =[NSMutableArray arrayWithObject:[UIImage imageNamed:@"logo6.png"]];
_images =[NSMutableArray arrayWithObject:[UIImage imageNamed:@"logo7.png"]];
_images =[NSMutableArray arrayWithObject:[UIImage imageNamed:@"logo8.png"]];
_images =[NSMutableArray arrayWithObject:[UIImage imageNamed:@"logo9.png"]];
_images =[NSMutableArray arrayWithObject:[UIImage imageNamed:@"logo10.png"]];
_images =[NSMutableArray arrayWithObject:[UIImage imageNamed:@"logo11.png"]];
_images =[NSMutableArray arrayWithObject:[UIImage imageNamed:@"logo12.png"]];
_images =[NSMutableArray arrayWithObject:[UIImage imageNamed:@"logo13.png"]];
_images =[NSMutableArray arrayWithObject:[UIImage imageNamed:@"logo14.png"]];
_images =[NSMutableArray arrayWithObject:[UIImage imageNamed:@"logo15.png"]];
_images =[NSMutableArray arrayWithObject:[UIImage imageNamed:@"logo16.png"]];

NSLog(@"ha ha ha:%d",_images.count);
Run Code Online (Sandbox Code Playgroud)

iphone xcode objective-c ios

1
推荐指数
2
解决办法
7580
查看次数

使用JSON在表视图中加载数据时,应用程序崩溃

我正在表视图中加载JSON数据.问题是,如果我滚动表视图,我的应用程序崩溃.以下是代码:

    - (void)viewDidLoad {
    [super viewDidLoad];
    jsonurl=[NSURL URLWithString:@"http://www.1040communications.net/sheeba/stepheni/iphone/stephen.json"];

    jsonData=[[NSString alloc]initWithContentsOfURL:jsonurl];

    jsonArray = [jsonData JSONValue]; 


    items = [jsonArray objectForKey:@"items"];

    story = [NSMutableArray array];
    description1 = [NSMutableArray array];
    media1 = [NSMutableArray array];

    for (NSDictionary *item in items )
    {
        [story addObject:[item objectForKey:@"title"]];
        [media1 addObject:[item objectForKey:@"media"]];


    }
     NSLog(@"booom:%@",story);

}

    - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
    return 1;
}

    - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
    return [story count];
}


// Customize the appearance of table view cells.
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {

    static NSString *CellIdentifier …
Run Code Online (Sandbox Code Playgroud)

scroll objective-c uitableview

1
推荐指数
1
解决办法
384
查看次数

如何在iphone中更改uiwebview中的文本颜色

我正在解析一个RSS源并在webview中显示它我使用图像视图将webview的背景颜色设置为黑色.解析后的数据存储在NSString中...我想要的是更改textcolor,fontsize,字符串数据的fonttype ..

self.itemTitle.text=[item objectForKey:@"title"];

[self.itemSummary loadHTMLString:[item objectForKey:@"description"] baseURL:nil];
[self.itemSummary setClipsToBounds:YES];

self.itemSummary.opaque=NO;

self.itemSummary.backgroundColor=[UIColor clearColor];
Run Code Online (Sandbox Code Playgroud)

xcode objective-c

1
推荐指数
1
解决办法
8778
查看次数

webview中的NetworkActivity指示器

我有一个基于视图的应用程序包含一个单击按钮的按钮带你到一个Web视图..我想要的是netwokActivityindicator旋转..在完成加载网页后我希望networkActivity指标消失...下面是码

-(IBAction)Button4

{

WebViewGive *newEnterNameController4 = [[WebViewGive alloc] initWithNibName:@"WebViewGive" 

bundle:[NSBundle mainBundle]];

 [[self navigationController] pushViewController:newEnterNameController4 animated:YES];

[newEnterNameController4 release];


}


- (void)viewDidLoad {
    [super viewDidLoad];

    [UIApplication sharedApplication].networkActivityIndicatorVisible=YES;
    self.urlAddress1 = @"http://www.youtube.com/user/stevenandkeirabanks";

    self.url1 = [NSURL URLWithString:urlAddress1];

    self.requestObj1 = [NSURLRequest requestWithURL:url1];

    [webViewAnnouncements loadRequest:requestObj1];

    }
Run Code Online (Sandbox Code Playgroud)

如果即时通讯使用下面的网络活动指标

[webViewAnnouncements loadRequest:requestObj1];
Run Code Online (Sandbox Code Playgroud)

我得到一个flickr而不是活动指示器的swrling

xcode objective-c

0
推荐指数
1
解决办法
921
查看次数

如何在android中使用facebook api注销

我使用facebook开发者指南使用facebook api for android.我能够实现facebook api for android的登录.我想实现注销功能.我试过跟随开发者指南,但不知道我必须实现哪个地方.如果你们帮我解决下面的代码,我将不胜感激.

public class FacebookandroidsdkActivity extends Activity {
    /** Called when the activity is first created. */

    Facebook facebook = new Facebook("252039928190210");
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);

        facebook.authorize(this, new DialogListener() {
            @Override
            public void onComplete(Bundle values) {}

            @Override
            public void onFacebookError(FacebookError error) {}

            @Override
            public void onError(DialogError e) {}

            @Override
            public void onCancel() {}
        });
    }

    @Override
    public void onActivityResult(int requestCode, int resultCode, Intent data) {
        super.onActivityResult(requestCode, resultCode, data);

        facebook.authorizeCallback(requestCode, resultCode, data); …
Run Code Online (Sandbox Code Playgroud)

java android facebook-graph-api

0
推荐指数
2
解决办法
1万
查看次数