小编use*_*878的帖子

为什么我要在程序中使用结构?

我看到很多结构代码,如下所示

struct codDrives {
   WCHAR letter;
   WCHAR volume[100];
} Drives[26];
Run Code Online (Sandbox Code Playgroud)

我们可以使用类似的变量或数组来存储数据.

但我不确定为什么我会在程序中使用结构?

c++

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

在UIDevice currentDevice上引导我

我使用以下代码来设置设备方向

[[UIDevice currentDevice] setOrientation:UIInterfaceOrientationLandscapeRight];
Run Code Online (Sandbox Code Playgroud)

当我使用我得到警告,我发现以下代码来解决该警告.

@interface UIDevice (MyPrivateNameThatAppleWouldNeverUseGoesHere)
- (void) setOrientation:(UIInterfaceOrientation)orientation;
@end
Run Code Online (Sandbox Code Playgroud)

现在我想知道的是......

应用程序商店是否可以接受此代码在应用程序中?

谢谢你的帮助!.

iphone iphone-sdk-3.0

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

在地图注释中显示图像

使用下面的代码,我可以显示标题和副标题,我想在其中显示图像.那可能吗?如果是这样,请帮助我.

MKPointAnnotation *aAnnotationPoint = [[MKPointAnnotation alloc] init];

aAnnotationPoint.title = @"Virginia";

aAnnotationPoint.subtitle = @"Test of sub title";

// Add the annotationPoint to the map
[myMapView addAnnotation:aAnnotationPoint];
Run Code Online (Sandbox Code Playgroud)

iphone mkmapview ios4

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

如何将UIButton放入uitableview单元格?

我能够创建一个tableviewwith textlabel和with detaillabeltext.

除此之外,是否可以添加UIButton到单元格中.

我的意思是在详细说明后,我可以放置一个UIButton(如"删除"按钮)

目前我有以下代码

// Customize the appearance of table view cells.
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
//-----------------------------------------------------------------------------------------------------
{

    static NSString *CellIdentifier = @"Cell";

    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];

    profileName = [appDelegate.sentItemsList objectAtIndex:indexPath.row];

    if (cell == nil) 
    {
        cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:CellIdentifier] autorelease];

        cell.selectionStyle = UITableViewCellSelectionStyleNone;
    }

    NSString *subjectData = [profileName.sent_subject stringByTrimmingCharactersInSet: [NSCharacterSet whitespaceAndNewlineCharacterSet]];

    cell.textLabel.text = [NSString stringWithFormat: @"%@ ", subjectData];

    cell.textLabel.font = [UIFont boldSystemFontOfSize:13];


    NSString *CompanyName …
Run Code Online (Sandbox Code Playgroud)

iphone uibutton uitableview ios4

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

滑块没有移动

我正在我的应用程序中实现滑块,如下所示...

Slider = new QSlider(this);
Slider->setOrientation (  Qt::Horizontal );
Run Code Online (Sandbox Code Playgroud)

当我运行应用程序时,它显示滑块,但我无法移动滑块手柄...

我做错了什么......

qt

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

弹出视图通知

我有一个流行的视图.当这个popover被解雇时,我想得到通知.

有什么办法吗?

请帮帮我.

iphone iphone-sdk-3.0 uipopovercontroller

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

有关iPhone错误的问题

当我运行我的下面的代码时,它会在我的设备上给出这个响应....

- (void) requestProductData
{
 //
 NSString *str = [[NSString alloc] initWithFormat:@"com.mycompany.inapppurchasetesting.productid"];//Same as the Product Id displayed in Itunes Connect//"]; 

 SKProductsRequest *request= [[SKProductsRequest alloc] initWithProductIdentifiers:[NSSet setWithObject:str]]; 

 request.delegate = self;

 [request start];
 //
 //NSSet *productIDs = [NSSet setWithObjects:@"com.mycompany.inapppurchasetesting.productid", nil];

 //SKProductsRequest *request = [[SKProductsRequest alloc] initWithProductIdentifiers:productIDs];

 //request.delegate = self;

 NSLog(@"Requesting");

 //[request start];
}

- (void)productsRequest:(SKProductsRequest *)request didReceiveResponse:(SKProductsResponse *)response
{
    NSArray *myProduct = response.products;

 NSArray *myInvalidProducts = response.invalidProductIdentifiers;

 NSLog(@"Did recieve response");

    NSLog(@"Response count is %d",response.products.count);
 NSLog(@"Invalid response count is %d",response.invalidProductIdentifiers.count);

 for (int i …
Run Code Online (Sandbox Code Playgroud)

iphone iphone-sdk-3.0

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

uitableview复选框重置问题

我有20行的uitableview,显示了许多食品.

每个食品都有一个复选框.

我的问题是:如果我检查复选框的第一行,然后滚动tableview,复选标记.

我怎么解决这个问题?请帮帮我.

代码更新:

- (IBAction)buttonAction:(id)sender
{
  if ([sender isKindOfClass:[UIButton class]])
  {
    UIButton *checkboxButton = (UIButton*)sender;

    checkboxButton.selected = !checkboxButton.selected;

    NSIndexPath *indexPath = [self.myTableView indexPathForCell:(UITableViewCell*)[[checkboxButton superview] superview]];

    BOOL selected = [[selectedArray objectAtIndex:[indexPath row]] boolValue];

    [selectedArray replaceObjectAtIndex:[indexPath row] withObject:[NSNumber numberWithBool:!selected]];

      if (!self.checkedIndexPaths)
          checkedIndexPaths = [[NSMutableSet alloc] init];

    if(selected == NO)
    {
          NSLog(@"cvbcvbNO BOOL value");    // ...

        //  If we are checking this cell, we do
        [self.checkedIndexPaths addObject:indexPath];
    }
    else
    {
      NSLog(@"cvbvbYES BOOL VALURE");

        //  If we are checking this cell, we …
Run Code Online (Sandbox Code Playgroud)

iphone ios4

0
推荐指数
2
解决办法
1064
查看次数

是否有可能区分是陆线呼叫还是移动线路呼叫?

我想知道如果我接到黑莓/安卓设备的电话,是否可以通过编程方式区分是陆线呼叫还是移动线路呼叫?

谢谢你的帮助

android blackberry

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