ios中是否有可用于星级的控件?所以我可以在UITableviewCell中使用它?
我知道有一些开放的开源控件,如DYRating等.但我不能在tableview单元格中添加它.
我有一个viewcontroller
想要显示3 tableviews
(因为内容和表属性不同).如何在一个表中添加3个表的委托方法viewcontroller
?
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
return 1;
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
return [array1 count];
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {}
Run Code Online (Sandbox Code Playgroud)
编辑
那么,如果我想uislider
使用自定义添加到一个表行cell
,当我滑动我想要更改显示亮度的值时,我该怎么办?
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
if (tableView == _displayThemes) {
return 1;
} else {
return 1;
}
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
if(tableView==_displayThemes) {
return 1;
} else {
return 5;
}
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
static NSString *CellIdentifier …
Run Code Online (Sandbox Code Playgroud) 我有一个plist,里面有一个数组,然后是一组字典元素?如何从plist中检索数据到我的数组?
如何在一个数组中获取类别名称?
如何在代码上从下到上移动视图:
colorView.hidden=NO;
colorView=[[UIView alloc]init];
colorView.frame=CGRectMake(0,480,320, 480);
colorView.bounds=CGRectMake(0,200,320, 280);
colorView.backgroundColor=[UIColor greenColor];
colorView.alpha=1.0f;
[webView addSubview:colorView];
[self.view addSubview:webView];
[self createTransparentView];
Run Code Online (Sandbox Code Playgroud)
那我怎么能在这里添加动画呢?
我在storyboard项目中为导航栏创建了一个标题,但当我移动到下一个viewcontroller时,后退按钮显示的名称与我之前的导航栏(主导航栏)标题相同.我可以设置单独的标题和后退按钮名称吗?
我尝试了下面的代码,但它不起作用?为什么?
self.navigationItem.title=@"Recent Books";
self.navigationItem.backBarButtonItem.title=@"Back";
Run Code Online (Sandbox Code Playgroud) 我在ViewDidLoad
方法中有一个包含以下元素的数组
inputArray = [NSMutableArray arrayWithObjects:@"car", @"bus", @"helicopter", @"cruiz", @"bike", @"jeep", nil];
Run Code Online (Sandbox Code Playgroud)
我还有一个UITextField
用于搜索的元素.所以一旦我输入一些东西UITextField
,我想检查该字符串是否存在"inputArray"或not.If它不与inputArray元素匹配然后从inputArray相应的元素.
for (NSString* item in inputArray)
{
if ([item rangeOfString:s].location == NSNotFound)
{
[inputArray removeObjectIdenticalTo:item];//--> Shows Exception
NSLog(@"Contains :%@",containsAnother);
}
}
Run Code Online (Sandbox Code Playgroud)
但此代码显示异常,与"removeobject:"相关的内容
例外:
Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[__NSCFConstantString rangeOfString:options:range:locale:]: nil argument'
*** First throw call stack:
`
Run Code Online (Sandbox Code Playgroud) 我有一个带有许多视图控制器的故事板项目,我创建了一个名为"connecter.h,connector.m"的类,现在可以将此类连接到一个.xib文件吗?
请帮我.
我下载了一个名为AePubReader的开源epub阅读器,它的工作正常.但是当我试图在xcode 4.6中集成我的应用程序时,由于ARC而显示出很多错误.所以我选择了这些文件并设置了"-fno-objc-arc"然后它显示错误,如#include <libxml/tree.h> not found![this is the error i got ][1]
$(SDK_DIR)"/ usr/include/libxml2我添加了这一行然后该问题得到解决,但之后它显示"43错误"类似"Apple Mach-O Linker Error"的大部分内容它们与xml文件有关
我的错误消息
体系结构i386的未定义符号:"_ htmlParseDoc",引用自: - CXHTMLDocument.o中的[CXHTMLDocument initWithXHTMLString:options:error:]
"_htmlReadMemory",引自: - [CXHTMLDocument initWithXHTMLData:encoding:options:error:]在CXHTMLDocument.o"_xmlAddChild"中,引自: - [CXMLDocument(CXMLDocument_CreationExtensions)addChild:]在CXMLDocument_CreationExtensions.o中 - [CXMLElement(CXMLElement_CreationExtensions)addChild :] CXMLElement_CreationExtensions.o - CXMLElement_CreationExtensions.o中的[CXMLElement_CreationExtensions] setStringValue:]"_ xmlAddPrevSibling",引自: - CXMLDocument_CreationExtensions.o"_xmlCopyNode"中的[CXMLDocument(CXMLDocument_CreationExtensions)insertChild:atIndex:],引用自: - [ CXMLNode copyWithZone:]在CXMLNode.o中
"_xmlDocDumpFormatMemory", referenced from:
-[CXMLDocument description] in CXMLDocument.o
Run Code Online (Sandbox Code Playgroud)
"_xmlDocDumpMemory",引用自: - CXMLDocument.o中的[CXMLDocument XMLDataWithOptions:]"_xmlDocGetRootElement",引自: - CXMLDocument.o中的[CXMLDocument initWithData:encoding:options:error:] - CXMLDocument.o中的[CXMLDocument rootElement]" _xmlDocSetRootElement",引自:CXMLNode_CreationExtensions.o中的+ [CXMLNode(CXMLNode_CreationExtensions)documentWithRootElement:] - CXHTMLDocument.o"_xmlFree"中的[CXHTMLDocument initWithXHTMLString:options:error:],引用自: - CXMLDocument.o中的[CXMLDocument XMLDataWithOptions:] - CXMLDocument.o中的[CXMLDocument描述]"_xmlFreeDoc",引自: - CXMLDocument.o中的[CXMLDocument dealloc]"_xmlFreeNode",引用自: - CXMLNode.o中的[CXMLNode dealloc]"_xmlGetCharEncodingName",引用自: - [ CXHTMLDocument:initWithXHTMLString:options:error:]在CXHTMLDocument.o"_xmlGetLastError"中,引用自: - …
如何为UIWebView添加背景图像作为纹理?我使用以下代码,但它无法正常工作?
_webView.backgroundColor=[UIColor colorWithPatternImage:[UIImage imageNamed:@"light.jpg"]];
Run Code Online (Sandbox Code Playgroud) 如何检查应用程序是否已连接到互联网?目前,我在我的appdelegate.m
文件中使用此代码
dispatch_queue_t connectivityThread = dispatch_queue_create("com.gm.kart.connectivity", NULL);
dispatch_async(connectivityThread, ^{
while (true){
if([GMMConnectivity hasConnectivity])
NSLog(@"%@", @"connected");
else
NSLog(@"Not connected");
usleep(10000000);
}
});
Run Code Online (Sandbox Code Playgroud)
当我点击我的登录按钮时,我想检查互联网是否已连接NSnotificationcenter
?
请帮我
我有一个故事板项目,我添加了PSTCollectionview类和所有文件.然后我为我的viewcontroller创建了一个类"allbooks.h,.m in"PSUICollectionviewcontroller_"并且iam无法在我的viewcontroller上添加这个类???
GMMAllBooksGrid.h
#import <UIKit/UIKit.h>
@interface GMMAllBooksGrid : PSUICollectionViewController
@end
Run Code Online (Sandbox Code Playgroud) ios ×10
objective-c ×5
xcode ×4
uiview ×2
xcode4.6 ×2
animation ×1
background ×1
epub ×1
fractions ×1
ios6 ×1
libxml2 ×1
nsarray ×1
nsdictionary ×1
nsstring ×1
plist ×1
rating ×1
search ×1
storyboard ×1
uiimage ×1
uistoryboard ×1
uitableview ×1
uiwebview ×1
xib ×1