小编Ern*_*nyi的帖子

UIWebView中的脱机html5

我将不得不从收到的html5文件创建一个离线应用程序(只是在UIWebView中显示它,我不知道它将是多个页面还是只有一个).我对html编程等知识非常有限,不幸的是由于篇幅有限,我不能花太多时间阅读它.尝试在webview中显示离线状态或者我需要注意的其他"捕获"是否有任何限制?

先感谢您.

html5 uiwebview ios

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

正确发布UIImagePickerController

我对此有点困惑,因为我已经看到太多不同的变体而且不确定哪一个是正确的方法.目前我有:

- (IBAction)pickImageFromLibrary:(id)sender
{
    UIImagePickerController *picker = [[UIImagePickerController alloc] init];

    picker.delegate = self;
    picker.sourceType = UIImagePickerControllerSourceTypePhotoLibrary;

    [self presentModalViewController:picker animated:YES];

    //  [picker release];
}

- (void)imagePickerController:(UIImagePickerController *)picker
didFinishPickingMediaWithInfo:(NSDictionary *)info
{   
    UIImage *image = [info objectForKey:@"UIImagePickerControllerOriginalImage"];

    UIImageView *imageView = [[UIImageView alloc]initWithFrame:CGRectMake(0.0f, 10.0f, 320.0f, 264.0f)];

    self.studyView = imageView;

    [imageView release];

    [self.tableView setTableHeaderView:studyView];

    self.fitImage = [ImageHelper image:image fitInView:studyView];

    if (picker.sourceType == UIImagePickerControllerSourceTypeCamera)
    {
        UIImageWriteToSavedPhotosAlbum(image, self, @selector(image:didFinishSavingWithError:contextInfo:), nil);
    }

    studyView.image = self.fitImage;

    [self dismissModalViewControllerAnimated:YES];

    [picker release];
 }
Run Code Online (Sandbox Code Playgroud)

UIImagePickerController在第一种方法中分配,但是当我解雇它时,仅在第二种方法中释放它是不合逻辑的?

uiimageview uiimagepickercontroller uiimage ios4

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

将格式化的字符串保存为c#中的文件名问题

嗨伙计们,我最近才开始使用c#,所以我对它的语法还不是很熟悉,而且我遇到了一个问题.我想将当前时间写入文件名.我正在使用以下代码:

DateTime now = DateTime.now;
string dateString = string.Format(@"Z:\test\{0}.bmp",now.ToString("s"));
bitmap.Save(dateString);
Run Code Online (Sandbox Code Playgroud)

现在这给了我一个无法访问文件路径错误.显然,这事做的":"在(至少当我给一个now.ToString("d")),这样可以节省精时间的字符.有什么想法导致这个?谢谢.

c#

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

UILables无法在UITableViewCell中正确更新

几天来一直有这个问题,似乎无法找到解决方案.这可能是一些非常基本的东西,但仍然无法提出解决方案.

我有一堆标签嵌套在表格视图单元格中,带有编辑导航控制器按钮,可以转到另一个表格视图.此表视图具有将数据存储到SQLite数据库的文本字段.标签从数据库返回某些值.现在这部分完美无缺.但是,当我更新文本字段并导航回标签时,标签不会更新,如果我滚动表格以使修改后的单元格不在视图中,那么它会更新,所以认为问题是单元格仍然具有旧值缓存,只有在它出列时才释放它.

部分代码:(至少我认为这是重要的,因为这是创建单元格的地方)

欢迎任何帮助.谢谢

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {

static NSString *CellIdentifier = @"ContactsDetailCell";


UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) {
    cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease];
}
// Configure the cell.
Run Code Online (Sandbox Code Playgroud)

int row = [indexPath row]; int section = [indexPath section];

NSDictionary*resultSet = [sqliteManager queryRow:[NSString stringWithFormat:@"SELECT*FROM contacts WHERE id =%d;",contactsId]];

switch(section){case 0:switch(row){case 0:cell.textLabel.text = @"Name:";

UILabel *nameLabel = [[UILabel alloc] initWithFrame: CGRectMake(90, 10, 200, 25)];
  nameLabel.text = [resultSet objectForKey:@"name"];
  nameLabel.textColor = [UIColor blackColor]; …
Run Code Online (Sandbox Code Playgroud)

iphone objective-c uitableview uilabel

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