小编D_D*_*D_D的帖子

子类UITableView更改节索引的字体颜色?

我有一个深色背景,UITableView顶部有一个.默认情况下,截面索引是半透明的,带有深色文本颜色.我想将节索引的文本颜色更改为与制作UITableViewCell标题标签相同的颜色.我已经阅读了一下,似乎你必须继承它UITableView?我该怎么做呢?

iphone cocoa-touch uitableview

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

iOS多个代表

我需要几个人view controllers才能知道人员dictionary的变化.我已经创建了一个协议,但据我所知,delegate属性只能有一个delegate,而不是一个数组delegates.我知道我可以使用它实现这个NSNotification,但是有什么方法可以实现delegation吗?谢谢!

iphone delegates delegation ios ios5

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

如何从下面的方法获取新的位置

-(void)mapView:(MKMapView *)mapView 
    annotationView:(MKAnnotationView *)view                  
    didChangeDragState:(MKAnnotationViewDragState)newState 
    fromOldState:(MKAnnotationViewDragState)oldState
Run Code Online (Sandbox Code Playgroud)

iphone mapkit mkannotation ios

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

如何在phpMadAdmin中查看phpmyadmin用户的所有数据库?

我一直在使用命令行成功使用MySQL,并创建了各种数据库(主要用于CMS).

我决定尝试使用phpMyAdmin我在Joomla的一本书中提到过的.

但是当我点击Databases时,我只看到information_schema,phpMyAdmin和test.

我希望能够管理我的所有数据库(可能提供适当的凭据).可能相关的事实是,如果我以phpmyadmin用户身份登录mysql 并执行show数据库; 查询,我只看到那三个数据库.

我是否需要某种涉及show_db_priv(授予phpmyadmin用户)的授权?如果就是这样,那么这样做的确切语法是什么?当我为这个用户做一个节目授予时,我可以看到它show_db_priv不是其中之一.

mysql phpmyadmin

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

iOS中的LinkedIn集成:邀请API不起作用

我正在尝试在我的iOS应用程序中集成LinkedIn,我需要进行身份验证,然后获取个人资料详细信息并从我的应用程序发布到LinkedIn.我使用这个示例项目LinkedIn OAuth示例客户端作为参考非常成功地做了所有这些事情,我做了一些修改,一切都运行得很好.我也使用LinnkedIn API中的细节 来实现这一点.接下来,我需要从同一个应用程序发送连接到LinkedIn的邀请.我尝试使用Invitataion API.

这是我的代码片段:

-(void)sendInvitationToconnectTo:(NSString *)emailAddress withMessage:(NSString *)text

{

    NSURL *url = [NSURL URLWithString:@"http://api.linkedin.com/v1/people/~/mailbox"];    
    OAMutableURLRequest *request = [[OAMutableURLRequest alloc] initWithURL:url
                                    consumer:oAuthLoginView.consumer
                                       token:oAuthLoginView.accessToken
                                    callback:nil
                           signatureProvider:[[OAHMAC_SHA1SignatureProvider alloc] init]];
    [request setValue:@"application/json" forHTTPHeaderField:@"Content-Type"];

    NSDictionary *temp=[[NSDictionary alloc]initWithObjectsAndKeys:@"/people/email=userName@gmail.com",@"_path",@"userName1",@"first-name",@"userName2",@"last-name", nil];

    NSDictionary *temp2=[[NSDictionary alloc] initWithObjectsAndKeys:temp,@"person",nil];
    NSArray *arr2=[[NSArray alloc]initWithObjects:temp2, nil];
    NSDictionary *value=[[NSDictionary alloc]initWithObjectsAndKeys:arr2,@"values", nil];
    NSDictionary *dict3=[[NSDictionary alloc]initWithObjectsAndKeys:@"friend",@"connect-type",nil];
    NSDictionary *dict4=[[NSDictionary alloc] initWithObjectsAndKeys:dict3,@"invitation-request", nil];

    NSDictionary *dict=[[NSDictionary alloc]initWithObjectsAndKeys:dict4,@"item-content",@"Say yes!",@"body",@"Invitation to connect.",@"subject",value,@"recipients", nil];

    NSString *updateString = [dict JSONString];
    NSLog(@"updateString …
Run Code Online (Sandbox Code Playgroud)

iphone objective-c linkedin ios linkedin-jsapi

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

UDID更换?

我知道[[UIDevice currentDevice] uniqueIdentifier]被拒绝了,我用过:

- (NSString *) uniqueDeviceIdentifier{
    NSString *macaddress = [[UIDevice currentDevice] macaddress];
    NSString *bundleIdentifier = [[NSBundle mainBundle] bundleIdentifier];

    NSString *stringToHash = [NSString stringWithFormat:@"%@%@",macaddress,bundleIdentifier];
    NSString *uniqueIdentifier = [stringToHash stringFromMD5];

    return uniqueIdentifier;
}
Run Code Online (Sandbox Code Playgroud)

如果我的方法未经Apple批准,我可以使用哪种方法获取唯一标识符?

iphone ios

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

哪个最好:通过@synthesize或使用self关键字调用属性

发布ObjectiveC初学者级别问题.当我使用属性声明对象时,我发现我们可以通过2种方法访问特定属性.

@property(nonatomic,retain) NSString *str;
Run Code Online (Sandbox Code Playgroud)
  1. 使用@synthesize propertyname 例如: @synthesize str;

  2. 通过使用关键字self 例如:self.str;

那么这两种方法之间的区别是什么,哪种更合适.谢谢你的时间

properties objective-c self ios synthesize

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

UITabBarController将操作设置为特定选项卡

我想一个动作设置为特定tabUITabBarController.我怎样才能做到这一点?请参阅下面的代码: 使用代码更新

@interface AccountTabViewController : UIViewController <UITabBarControllerDelegate, UITabBarDelegate>
{
    IBOutlet UITabBarController *tabController;
    IBOutlet UITabBar *tabBar;
}

- (void)tabBarController:(UITabBarController *)tabBarController didSelectViewController:(UIViewController *)viewController
{
    if(tabBarController.selectedIndex == 0) 
    {
        [self dismissModalViewControllerAnimated:YES];
    }
}
Run Code Online (Sandbox Code Playgroud)

它永远不会进入方法!请帮忙.

iphone objective-c uitabbarcontroller

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

对象的潜在泄漏,即使在 ARC 中?

我正在使用以下代码并且正在使用 ARC

NSString *text;
static NSString *CellIdentifier=@"Cell";
FeedsCell *cell= [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil)
{
    cell = [[FeedsCell alloc] initWithStyle:UITableViewCellStyleSubtitle  reuseIdentifier:CellIdentifier];
}

if (indexPath.row == [feedsData count]-1)
{
    [spinner startAnimating];
    [spinner setHidesWhenStopped:YES];

    OnDemand_fetch *getData = [[OnDemand_fetch alloc] init];

    if(nextUrl != NULL)
    {

        NSString *nextfbUrl = [getData getnextFbfeedUrl];
        NSString *nexturlEdited = [nextfbUrl stringByReplacingOccurrencesOfString:@"|" withString:@"%7C"];
        [demandfetch getFeedsInBackground:nexturlEdited];



    }
    else
    {
        [spinner stopAnimating];
        self.myTableView.tableFooterView=nil;
     }   
Run Code Online (Sandbox Code Playgroud)

在分析时,显示警告:“在第 267 行分配并存储到‘getData’中的对象可能存在泄漏。”

任何人都可以建议避免这种情况的方法吗?这会造成什么麻烦吗?

谢谢

iphone ipad ios ios5

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

MFMailComposeViewController的几个附件

我已经UIImage从我的应用程序成功发送了一封带有附件的电子邮件,但是可以附加多个图像MFMailComposeViewController吗?

xcode objective-c email-attachments ios mfmailcomposeviewcontroller

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