我有一个带有3个类别的UITableView.我正在使用此代码:
NSArray *arrayOne = [NSArray arrayWithObjects: @"one", @"two", "three", "four", nil];
NSDictionary *dictOne = [NSDictionary dictionaryWithObject:arrayOne forKey:@"Elements"];
Run Code Online (Sandbox Code Playgroud)
对于每个类别.
我怎么能按字母顺序排序呢?我在这里读了一些答案,但我没有发现任何东西.
如果我使用此答案中的代码方法在UITableView中按字母顺序对自定义对象进行排序,则它不起作用.我有代码:
[listObjects addObject:dictOne];
Run Code Online (Sandbox Code Playgroud)
如果我放
[listOfTitles sortUsingDescriptors:[NSArray arrayWithObject:titleSorter];
Run Code Online (Sandbox Code Playgroud)
它不起作用.
任何帮助赞赏
我疯了.
我正在使用XCode 4,最后我完成了我的应用程序,我即将把它提交到App Store,上传到iTunes Connect.我试图建立档案,但这个警告出现了:
Application failed codesign verification. The signature was invalid, or it was not signed with an Apple submission certificate. (-19011)
Run Code Online (Sandbox Code Playgroud)
我一整天用谷歌搜索,我试图在Provisioning Center更新我的所有证书,我甚至试图用Application loader上传它,但发生了什么事.那里也有同样的错误.我试图通过管理器中的存档选项卡验证它,但任何事情,这个警告都不会消失.
我在这里已经阅读了一些答案,即使答案有点陈旧,任何对我有用的东西,我也试图重新安装XCode,我试图在Build in Targets中选择正确的配置文件.
感谢任何能帮助我的人
编辑:
当我尝试启动一个新项目并选择"Build for Archive"然后选择Archive时,会出现警告,但我仍然可以将该档案共享为ipa.我试图将旧项目中的所有文件复制到新项目中,构建存档,存档.但当我选择"分享"为.ipa时,它会显示错误
The operation couldn't be completed. No such files or directory.
Run Code Online (Sandbox Code Playgroud)
可能这是因为我为我的项目添加了2个框架吗?我应该从Target或Project中选择一些东西吗?此外,我想说我的所有配置文件都没问题,证书等.我试图通过启用NO"Validate built product"来绕过错误-19011.
EDIT2:-19011不再显示,但当我尝试验证或提交时,我收到此错误:
The archive is invalid. var/folders/*randomnumbers* app.ipa does not exist.
Run Code Online (Sandbox Code Playgroud)
在这种情况下我该怎么办?我已经阅读了一些答案但没有奏效.

我试图使用带有NSURLConnection的MBProgressHUD.
MBProgressHUD演示项目中的示例报告:
- (IBAction)showURL:(id)sender {
NSURL *URL = [NSURL URLWithString:@"https://github.com/matej/MBProgressHUD/zipball/master"];
NSURLRequest *request = [NSURLRequest requestWithURL:URL];
NSURLConnection *connection = [[NSURLConnection alloc] initWithRequest:request delegate:self];
[connection start];
[connection release];
HUD = [[MBProgressHUD showHUDAddedTo:self.navigationController.view animated:YES] retain];
HUD.delegate = self;
}
- (void)connection:(NSURLConnection *)connection didReceiveResponse:(NSURLResponse *)response {
expectedLength = [response expectedContentLength];
currentLength = 0;
HUD.mode = MBProgressHUDModeDeterminate;
}
- (void)connection:(NSURLConnection *)connection didReceiveData:(NSData *)data {
currentLength += [data length];
HUD.progress = currentLength / (float)expectedLength;
}
- (void)connectionDidFinishLoading:(NSURLConnection *)connection {
HUD.customView = [[[UIImageView alloc] initWithImage:[UIImage imageNamed:@"37x-Checkmark.png"]] autorelease]; …Run Code Online (Sandbox Code Playgroud) 我正在将网站重定向到我创建的子目录.该子目录包含WordPress的安装,现在我想从网站屏蔽子目录URL.
现在它就像http://mywebsite.com/apt/
我想从URL中删除/ apt /.
我今天尝试了一切,在Google上搜索过,试图在我在这里找到的htaccess上写各种各样的东西,但没有任何效果.
在网站主目录的htaccess上,我使用此代码重定向
RewriteCond %{HTTP_HOST} ^mywebsite.com$ [OR]
RewriteCond %{HTTP_HOST} ^www.mywebsite.com$
RewriteRule ^/?$ "http\:\/\/www\.mywebsite\.com/\apt" [R=301,L]
Run Code Online (Sandbox Code Playgroud)
在我的/ apt /文件夹中的那个
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /apt/
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /apt/index.php [L]
</IfModule>
# END WordPress
Run Code Online (Sandbox Code Playgroud)
有人可以建议我如何从URL隐藏/ apt/extension?非常感谢.
我正在编写Chrome扩展程序,可在标签页中打开所有用户的书签.
到目前为止,我已经制作了popup.html,它在标签栏中打开所选文件夹.
我正在创建一个设置页面,我想知道如何访问和显示用户书签的每个项目,以便选择要打开的书签以及复选框.
用更少的话说,我想:
Bookmarks bar
---> Bookmark1
---> Bookmark2 //display those bookmarks with a checkbox
---> Bookmark1
Run Code Online (Sandbox Code Playgroud)
为了有
Excluded bookmarks:
[x]Bookmark 1
[ ]Bookmark 2
[x]Bookmark 3
Run Code Online (Sandbox Code Playgroud)
提前致谢
在定制我的应用程序时,我变得非常沮丧.我已经创建并设计了几乎整个应用程序,包括导航栏,工具栏,tabBar等,但每次MFMailComposeViewController,MFMessageComposerViewController,Twitter或Facebook共享者甚至是QuickLook View Controller都会发挥作用时,应用程序会崩溃并显示以下消息:
*** Assertion failure in -[UICGColor encodeWithCoder:].
*** Terminating app due to uncaught exception 'NSInternalInconsistencyExceptionì, reason: 'Only RGBA or White color spaces are supported in this situation.'
Run Code Online (Sandbox Code Playgroud)
我已经读到这是因为iOS 6将作曲家作为远程控制器进行管理,但我真的不知道如何解决这个问题.
因此,我不想删除邮件撰写功能或邮件撰写功能.
有没有人遇到过这个bug?
我已经有代码写了.问题是由于自定义UINavigationBars元素,UIAppearance正在使应用程序崩溃.码.
-(void)message{
if (_progressHUD){
[_progressHUD hide:YES];
}
MFMessageComposeViewController *controller = [[MFMessageComposeViewController alloc] init] ;
[controller setMessageComposeDelegate:self];
if([MFMessageComposeViewController canSendText])
{
controller.body = descriptionString;
controller.recipients = nil;
[self presentViewController:controller animated:YES completion:nil];
}
}
-(void)messageComposeViewController:(MFMessageComposeViewController *)controller didFinishWithResult:(MessageComposeResult)result{
[self dismissViewControllerAnimated:YES completion:nil];
}
-(void)email {
if (_progressHUD){
[_progressHUD hide:YES];
}
MFMailComposeViewController *composer …Run Code Online (Sandbox Code Playgroud) 我正在使用UIWebView从plist加载一些HTML文本.
我设法使其背景透明化
webView.opaque = NO;
webview.backgroundColor = [UIColor clearColor];
Run Code Online (Sandbox Code Playgroud)
但是内容,即从plist加载的文本,以令人不安的白色背景显示.
我正在加载它
NSString *descr = [NSString stringWithFormat:@"<html><head><style> body{font-size:16; font-family: Helvetica; color: black;} strong{font-family: Arial; font-weight: bold; font-size:16} .bg{background:transparent;}</style></head><body><div class='bg'>%@</div></body></html>",[item valueForKey:@"description"]];
[webView loadHTMLString:descr baseURL:nil];
Run Code Online (Sandbox Code Playgroud)
我已经尝试将.bg类背景颜色设置为rgba(255,0,0,0.0),但没有任何效果.
也试过设置 webView.scrollView.backgroundColor : [UIColor clearColor];
关于如何让UIWebView的内容背景透明的任何建议?
我是Xcode开发的新手,我想知道如何从2个输入生成随机数.
在IB中,我有2个文本字段(带数字键盘),指示要生成的数字的间隔(即从3到7).我想知道如何从2个文本字段获取输入并执行从这些输入生成随机数的方法.
当我分析我的代码时,我会开始这些:
Method returns an Objective-C object with a +1 retain count
Run Code Online (Sandbox Code Playgroud)
和
Object leaked: object allocated and stored into 'headerLabel' is not referenced later in this execution path and has a retain count of +1
Run Code Online (Sandbox Code Playgroud)
在这个方法上:
- (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section
{
// create the parent view that will hold header Label
UIView* customView = [[UIView alloc] initWithFrame:CGRectMake(15.0, 0.0, 300.0, 44.0)];
// create the button object
UILabel * headerLabel = [[UILabel alloc] initWithFrame:CGRectZero];
headerLabel.backgroundColor = [UIColor clearColor];
headerLabel.opaque = NO; …Run Code Online (Sandbox Code Playgroud) 在我的主tableView中,我有一些自定义单元格(基本上是带有imageView的单元格).
仅当我的plist上的值为false时才设置imageView.然后,当它为真时,imageView为零.
基本上当用户输入detailView时,该值设置为YES和cell.imageViewnil.
它没关系,它有效
我正在使用a searchDisplayController,当我搜索具有cell.imageView的东西时,进入detailView然后返回到searchResultsTable,单元格仍然是图像,而它不应该,但主tableView具有正确的单元格(所以,没有图像).
我认为它可能依赖于searchResultsTableView,但我不确定.我试过了
[self.searchDisplayController.searchResultsTableView reloadData];
Run Code Online (Sandbox Code Playgroud)
没有效果.
我怎么能重新加载searchResultsTableView,以便它显示正确的单元格,那些带有图像的那些以及那些没有图像的单元格?
任何帮助赞赏!
编辑
这是我的cellForRowAtIndexPath方法:
- (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] autorelease];
}
NSArray *rows;
if (tableView == self.searchDisplayController.searchResultsTableView) {
rows = filteredList; //for search
} else {
NSDictionary *section = [localSortedTips objectAtIndex:indexPath.section];
rows = [section objectForKey:@"Rows"];
}
NSDictionary *item …Run Code Online (Sandbox Code Playgroud) 我正在尝试用英语和意大利语本地化我的应用程序.
我得到了这部分代码:
-(IBAction)randomSN{
int text = rand() % 2;
switch (text) {
case 0:
textview.text =NSLocalizedString(@"YES", @"Sì");
break;
case 1:
textview.text = NSLocalizedString("@NO", @"No");
break;
default:
break;
}
}
Run Code Online (Sandbox Code Playgroud)
当我进入构建和运行时,会出现一些警告:
warning: passing argument 1 of 'localizedStringForKey:value:table:' from incompatible pointer type
Run Code Online (Sandbox Code Playgroud)
我认为它需要一张桌子才能工作或者?当它说时,警告仅在第二部分显示
textview.text = NSLocalizedString("@NO", @"No");
Run Code Online (Sandbox Code Playgroud)
此外,当我运行项目时,模拟器设置为英语(应用程序的主要语言是意大利语),我输入的Localizable.strings没有出现.
objective-c ×8
ios ×3
cocoa-touch ×2
uitableview ×2
xcode4 ×2
.htaccess ×1
css ×1
distribution ×1
ios4 ×1
localization ×1
memory-leaks ×1
numbers ×1
random ×1
redirect ×1
signature ×1
sorting ×1
uiappearance ×1
uiwebview ×1
url-masking ×1