我有多行和多列数据.但是iPhone UITableView只包含单列和多行.如何按照Apple的人机界面指南显示我的多列数据?
我需要在Blackberry中使用HTTP GET请求对URL进行编码.任何人都可以帮我找到如何实现这一目标.
我正在开发一个应用程序,它有一个图像和一些按钮,其位置在整个流程中保持不变.所以我将NSViewController子类化.这是我使用固定按钮和图像的应用程序的主视图.我添加了一个NSBox项目,其中将显示和交换各种子视图.如何在此框中的按钮单击事件上显示自定义视图?我尝试了以下代码:
intro = [[Introduction alloc] initWithNibName:@"Introduction" bundle:nil];
[intro setNextResponder:[self nextResponder]];
[self setNextResponder:intro];
[box setContentView:[intro view]];
Run Code Online (Sandbox Code Playgroud)
但是我收到以下错误: - [NSViewController loadView]加载了"简介"笔尖但没有设置视图.
文件所有者设置为简介类.
我有UITableViewController作为RootViewController.我需要根据从RootViewController的线程启动的另一个线程获取的数据向表中添加行.当我从其他线程返回到我的RootViewController的线程时,我有更新的数据,但我无法更新TableView.我打电话给[self.tableview reloadData];方法,但似乎没有用.我也试过这个[self.tableview setNeedsDisplay]电话但没有成功.如何使用新数据更新TableView?
In my RootViewController Class I have:
- (void) reload {
for(int i=0;i<[camDetails count];i++)
{
cCameraInformation *obj = [[cCameraInformation alloc] init];
obj = [camDetails objectAtIndex:i];
NSString *tString = [[NSString alloc] initWithFormat: @" Remote %s %s",[obj->sCameraid UTF8String],[obj->sCameraid UTF8String]];
[tableEntry addObject:tString];
}
[self.tableView reloadData];
}
Run Code Online (Sandbox Code Playgroud)
然后有一个接收类线程,它不断接收数据.它的基类是NSObject.所以,我使用Application委托类(它有一个RootViewController类的实例)来调用我的接收线程中的RootViewController类的重载数据方法.
我无法使用performSelectorOnMainThread调用上述方法.
我想知道我是否可以访问安装我的应用程序的目录.另外,我想在同一目录中创建一个子目录,以存储我在应用程序中捕获的所有图像.我还想用iPhone的默认图像查看器查看图像.可以这样做吗?
我正在使用Objective-C开发一个iPhone应用程序.我想访问另一个类中RootViewController类的NSMutableArray类型的数据成员.我试着让数组静态.但我想要一个非静态数组.我该如何实现这一目标?
我使用以下代码将字符串转换为日期,但它在转换时应用了设备的时区.
我不需要这个,但我希望从该字符串中获得相同的日期/时间
String = "2009-07-31 07:59:17.427"
Date = 2009-07-31 07:59:17.427
Date formatter = new Date(HttpDateParser.parse("2009-07-31 07:59:17.427"));
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS");
String strCustomDateTime = dateFormat.format(formatter);
Run Code Online (Sandbox Code Playgroud) 我需要在我的应用程序执行时存储某些信息,并在应用程序启动时再次获取它.我尝试使用GData将其存储在XML中,但没有成功.我使用NSFileHandle它没有给我一个错误,但它无法创建一个.txt文件用于读/写目的.有没有其他方法可以在iPhone上存储和检索数据.下面是我的NSFileHandle代码.
NSString *path = [[[NSBundle mainBundle] resourcePath] stringByAppendingPathComponent:@"myFile.txt"];
//NSFileHandle *fh = [NSFileHandle fileHandleForWritingAtPath:@"file://localhost/Users/shraddha/Desktop/info.txt"];
NSFileHandle *fh = [NSFileHandle fileHandleForWritingAtPath:@"myFile.txt"];
[fh seekToEndOfFile];
NSData *data = [camName dataUsingEncoding:NSASCIIStringEncoding];
[fh writeData:data];
[fh closeFile];
Run Code Online (Sandbox Code Playgroud)
阅读
NSString *path = [[[NSBundle mainBundle] resourcePath] stringByAppendingPathComponent:@"myFile.txt"];
//NSFileHandle *fh = [NSFileHandle fileHandleForReadingAtPath:@"file://localhost/Users/shraddha/Desktop/info.txt"];
NSFileHandle *fh = [NSFileHandle fileHandleForReadingAtPath:@"myFile.txt"];
if(fh == nil)
return nil;
else
{
NSData *data = [fh readDataOfLength:8];
NSString *retStr = [[NSString alloc] initWithData:data encoding:NSASCIIStringEncoding];
return retStr;
}
Run Code Online (Sandbox Code Playgroud) objective-c ×5
iphone ×4
cocoa ×3
cocoa-touch ×3
blackberry ×2
java ×2
macos ×2
ios ×1
java-me ×1
jde ×1
media-player ×1
string ×1
uitableview ×1