小编Pio*_*sik的帖子

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

iTunes Connect无效的预发布列车.

尝试提交应用存档时,我在Xcode中收到以下错误:

ERROR ITMS-9000:"无效的预发布列车.列车版本'2.1.5'已关闭以进行新的构建提交"

显示iTunes Connect错误的图像

有人有解决方案吗?这个版本已经在等待审核了.我拒绝了它,现在我正在尝试提交新版本.版本号相同,但我增加了内部版本号.

itunesconnect ios ios8

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

在字或边界处截断包含表情符号或unicode字符的字符串

问题

如何在不消除可能在我的长度中间发出的unicode字符的情况下截断给定长度的字符串?如何确定字符串中unicode字符开头的索引,以便我可以避免创建丑陋的字符串.具有A可见的一半的正方形是另一个被截断的表情符号字符的位置.

-(NSMutableAttributedString*)constructStatusAttributedStringWithRange:(CFRange)range

NSString *original = [_postDictionay objectForKey:@"message"];

NSMutableString *truncated = [NSMutableString string];

NSArray *components = [original componentsSeparatedByCharactersInSet:[NSCharacterSet whitespaceCharacterSet]];

for(int x=0; x<[components count]; x++)
{
    //If the truncated string is still shorter then the range desired. (leave space for ...)
    if([truncated length]+[[components objectAtIndex:x] length]<range.length-3)
    {
        //Just checking if its the first word
        if([truncated length]==0 && x==0)
        {
            //start off the string
            [truncated appendString:[components objectAtIndex:0]];
        }
        else
        {
            //append a new word to the string
            [truncated appendFormat:@" %@",[components objectAtIndex:x]];
        }

    }
    else …
Run Code Online (Sandbox Code Playgroud)

unicode objective-c nsstring ios emoji

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

如何使用MonoTouch.ObjCRuntime.Selector和Perform Selector发送参数

这是我发现的一个例子,但它们实际上省略了发送参数.

this.PerformSelector(new MonoTouch.ObjCRuntime.Selector("_HandleSaveButtonTouchUpInside"),null,0.0f);

[Export("_HandleSaveButtonTouchUpInside")]
    void _HandleSaveButtonTouchUpInside()
    {
...
}
Run Code Online (Sandbox Code Playgroud)

我希望能够做到这样的事情:

this.PerformSelector(new MonoTouch.ObjCRuntime.Selector("_HandleSaveButtonTouchUpInside"),null,0.0f);

[Export("_HandleSaveButtonTouchUpInside")]
    void _HandleSaveButtonTouchUpInside(NSURL url, NSData data)
    {
...
}
Run Code Online (Sandbox Code Playgroud)

如何更改PerformSelector Call以将params发送到方法?

c# iphone monodevelop xamarin.ios ios

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

什么是AFNetworking 2.0等效取消操作

我曾经能够cancelAllHTTPOperationsWithMethod:AFHTTPClient课堂上使用取消操作.取消操作的新方法是什么?

objective-c ios afnetworking-2

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

ImageMagick:使用具有重心的convert -composite分层图像

在此输入图像描述

背景

http://i.stack.imgur.com/wA2EL.png

覆盖

composite -gravity center overlay.png  background.jpg  result1.jpg
Run Code Online (Sandbox Code Playgroud)

http://i.stack.imgur.com/XgdA2.jpg

result1.jpg

convert -composite background.jpg overlay.png -gravity center result2.jpg
Run Code Online (Sandbox Code Playgroud)

result2.jpg

convert -composite background.jpg -gravity center tool_marker.png  result3.jpg
Run Code Online (Sandbox Code Playgroud)

result3.jpg

如何将convert作为可执行文件而不是复合文件来实现result1的结果?

谢谢!

overlay imagemagick image-processing composite

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

如何在Monotouch中获取iOS设备和版本

如何确定iPhone,iPod,iPad型号使用我的应用程序?我希望获得如:iPhone,iPhone 3G,iPhone 3GS等输出

就像这个简单目标C的答案:回答我在目标C中的问题

c# xamarin.ios ios

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

如何在UITableViewCell中的UITextView中一致地绘制NSAttributedString

我无法使用NSAttributedStrings在UITableViewCell中从UITextViews获得一致的结果.

内部 - (UITableViewCell*)tableView:(UITableView*)tableView cellForRowAtIndexPath:(NSIndexPath*)indexPath:

UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];

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

    headerText = [[UITextView alloc]initWithFrame:CGRectZero];
    [headerText setUserInteractionEnabled:NO];
    headerText.tag = HEADER_TEXT;
    [cell.contentView addSubview:headerText]; 
} else {
    headerText = (UITextView*)[cell.contentView viewWithTag:HEADER_TEXT];
}

//...setting up attributed strings


[headerText setAttributedText:headerString];

CGSize headerSize = [headerText sizeThatFits:CGSizeMake(246, CGFLOAT_MAX)];

headerText.frame = CGRectMake(45, 8, headerSize.width, headerSize.height);
Run Code Online (Sandbox Code Playgroud)

结果:

滚动之前没有内容设置

正如您所看到的,前两个似乎以我期望/想要的方式绘制文本.在最后两个中,UITextView sizeThatFits方法返回一个更大的大小,然后需要绘制文本,文本在框架中居中而不是紧紧到框架的顶部.这是一个问题,因为我希望能够根据uitextview框架高度布局其他视图.

滚出框架后返回: 在此输入图像描述

现在它变得更加奇怪,当重复使用单元格时,再次设置属性字符串.uitextview以不一致的方式绘制文本.

甚至将contentInsets设置为

headerText.contentInset = UIEdgeInsetsMake(-8, -8, -8, -8);
Run Code Online (Sandbox Code Playgroud)

不提供任何一致的结果:

在此输入图像描述

在使用contentinset设置滚动后: 在此输入图像描述

UITextView上是否有其他属性可以让我获得我需要的行为?

objective-c uitableview uitextview uikit nsattributedstring

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

iOS的BluetoothSocket相当于什么?

我想在我的蓝牙设备和 iPhone 之间传输文件。iOS 平台上有类似android.bluetooth.BluetoothSocket 的东西吗?

将不胜感激有关连接到蓝牙插座的一些代码示例。

android bluetooth ios

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

Apollo GraphQL 客户端 + Next.JS 错误处理

该组件很好地呈现了错误状态,但异常在控制台中显示为未捕获,并且在浏览器的下一个开发中显示对话框。有没有办法处理预期错误来抑制这种行为?

import { useMutation, gql } from "@apollo/client";
import { useEffect } from "react";

const CONSUME_MAGIC_LINK = gql`
  mutation ConsumeMagicLink($token: String!) {
    consumeMagicLink(token: $token) {
      token
      member {
        id
      }
    }
  }
`;

export default function ConsumeMagicLink({ token }) {
  const [consumeMagicLink, { data, loading, error }] =
    useMutation(CONSUME_MAGIC_LINK);

  console.log("DATA", data, "loading:", loading, "error:", error);

  useEffect(() => {
    try {
      consumeMagicLink({ variables: { token } });
    } catch (e) {
      console.log(e);
    }
  }, []);

  var text = "Link has expired …
Run Code Online (Sandbox Code Playgroud)

javascript reactjs react-apollo next.js apollo-client

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