我一直试图找到一些从操作栏中删除图标/徽标的方法,但我在搜索SO,Android的文档和Google之后发现的唯一一件事就是如何删除整个标题栏.那不是我想要的.只想从标题栏中删除图标/徽标.
谁知道怎么做到这一点?我想在XML中这样做.
早上
我一直致力于创建一个iOS应用程序,该应用程序使用存储的凭据NSURLCredentialStorage进行特定的保护空间.我现在已经到了proposedCredential用于获取存储凭据的地步.
我的问题是它正在回归null,而我似乎无法找到任何关于proposedCredential实际做什么以及为什么它没有返回我认为它应该返回的任何好的解释.
这就是我正在做的事情:
首先,我定义一个NSURLProtectionSpace,给出凭据并将它们存储在NSURLCredentialStorage.我已经检查过这是在我引用之前完成的,proposedCredential并且我传递的凭据是正确的.
NSURLProtectionSpace *protectionSpaceOne = [[NSURLProtectionSpace alloc]
initWithHost:xyz
port: 80
protocol:NSURLProtectionSpaceHTTP
realm:nil
authenticationMethod:NSURLAuthenticationMethodDefault];
//credential is initiated elsewhere.
[[NSURLCredentialStorage sharedCredentialStorage] setDefaultCredential:credential forProtectionSpace:protectionSpaceOne];
-(void)connection:(NSURLConnection *)connection didRecieveAuthenticationChallenge:(NSURLAuthenticationChallenge *)challenge{
//Has the authentication failed before?
if([challenge previousFailureCount]>0){
//Why?
NSError *error = [challenge error];
//Here I respond to the failure count
[[challenge sender]cancelAuthenticationCallenge:challenge];
}
NSURLCredential *proposedCredential = [challenge proposedCredential];
}
Run Code Online (Sandbox Code Playgroud)
有人可以告诉我proposedCredential实际做了什么,它是什么比较在一起来弄清楚它是否应该传递一个凭证,以及我可能从代码中遗漏了什么?
我目前正在开发一个具有全文搜索功能的IOS应用程序.通过在sqlite数据库上执行select语句来执行搜索,但问题是数据库中的许多值包含斯堪的纳维亚字母(Æ,Ö,Á等),并且我在转换语句时遇到问题而没有获取十六进制值为了这些信件.
这是我目前正在做的事情:
const char *sql = [[NSString stringWithFormat:
@"SELECT %@\
FROM Customer c\
JOIN Customer_Metadata cm ON c.CustomerId = cm.CustomerId\
WHERE cm.Name LIKE '%%%@%%'\
ORDER BY cm.Name", kCustomerSelect, searchString] UTF8String];
Run Code Online (Sandbox Code Playgroud)
现在kCustomerSelect是一个包含我想要选择的列的常量,而searchString包含用户输入.
这就像普通拉丁字母的魅力,但如果我传给Ö,作为searchString,我得到st\xc3\xb6.我知道简单地注销UTF8编码的字符串将无法正确表示字符串,但问题是我的select语句没有给我任何结果.
我在执行查询之前调用sqlite3_open()并从SQLite文档中调用*"如果调用sqlite3_open()或sqlite3_open_v2(),则数据库的默认编码为UTF-8,如果是sqlite3_open16,则为本机字节顺序的UTF-16 () 用来."*.
我已经通过更换使用不同的编码尝试UTF8String与cStringUsingEncoding:和尝试不同的编码.他们都没有工作(不是我期待他们,但至少想尝试).
任何和所有帮助或提示,将不胜感激.
编辑 我现在尝试使用SQLite数据库浏览器在数据库上运行相同的select语句,但没有得到任何结果.这让我相信这可能与我使用FTS3创建我的Customer_Metadata表有关.
MrDresden
我发现很多人询问关于如何有主视图中显示无论是在横向和纵向的,但我试图做的是不管有隐藏的设备方向的右主视图,然后从弹出中通过使用导航栏按钮.
如果有人能告诉我在设备重新定位时隐藏主视图的逻辑位于/执行的地方,那将对我有多大帮助.我一直在寻找的是配有适用于iOS的Xcode,主/详细信息视图模板,我注意到这两个以下方法在AppDelegate.m文件中声明,但我似乎无法找出他们正在从执行:
//Called when a button should be added to the nav bar for a view that is hidden
- (void)splitViewController:(UISplitViewController *)splitController willHideViewController: (UIViewController *)viewController withBarButtonItem:(UIBarButtonItem *)barButtonItem forPopoverController:(UIPopoverController *)popoverController
{
barButtonItem.title = NSLocalizedString(@"Master", @"Master");
[self.navigationItem setLeftBarButtonItem:barButtonItem animated:YES];
self.masterPopoverController = popoverController;
}
- (void)splitViewController:(UISplitViewController *)splitController willShowViewController:(UIViewController *)viewController invalidatingBarButtonItem:(UIBarButtonItem *)barButtonItem
{
// Called when the view is shown again in the split view, invalidating the button and popover controller.
[self.navigationItem setLeftBarButtonItem:nil animated:YES];
self.masterPopoverController = nil;
}
Run Code Online (Sandbox Code Playgroud)
所有帮助将不胜感激.