这是因为NSMutableArray和NSArray不是同一个类型造成的.
解决方法
// NSArray --> NSMutableArray
NSMutableArray *myMutableArray = [myArray mutableCopy];
// NSMutableArray --> NSArray
NSArray *myArray = [myMutableArr...
分类:
其他好文 时间:
2015-01-09 17:18:29
阅读次数:
392
https://oj.leetcode.com/problems/copy-list-with-random-pointer/http://blog.csdn.net/linhuanmars/article/details/22463599/**
*Definitionforsingly-linkedlistwitharandompointer.
*classRandomListNode{
*intlabel;
*RandomListNodenext,random;
*RandomListNode(intx)..
分类:
其他好文 时间:
2015-01-08 18:15:38
阅读次数:
106
下午好多干货啊~之前意识到编码能力很弱,今天接着发现知识储备也不好╮(╯▽╰)╭指针(pointer)的涵义不完全都是指针变量,有时也指地址函数名: pow 功 能: 指数函数(x的y次方) 用 法: double pow(double x, double y);以0x开始的数据表示16进制%x.....
分类:
其他好文 时间:
2015-01-06 00:34:53
阅读次数:
206
水平越来越菜了A 水题,注意后面全是1的情况B 调和级数呀。把倍数全部扫一遍。一个数是多个数的倍数的话肯定是大的比较优。然后可以用two pointer扫一下。C 就是一个置换群,把轮换找出来就好了。傻逼的写了好久。D 有意思的傻逼DP,容易得到dp[i] = max{dp[j] + max{abs...
分类:
其他好文 时间:
2015-01-05 01:51:24
阅读次数:
222
为期一周的培训已经结束了,现在就情况总结如下:1.函数形参含有指针的时候,要先判断,然后在继续 即if(NULL == pointer) return; 注意NULL放在前面 防止出错 当malloc动态申请内存的时候,要先判断是否申请成功,类似上面所述 在释放内存的时候,利用free()操作,然后...
分类:
其他好文 时间:
2015-01-04 18:54:09
阅读次数:
201
Given a binary tree
struct TreeLinkNode {
TreeLinkNode *left;
TreeLinkNode *right;
TreeLinkNode *next;
}
Populate each next pointer to point to its next right node....
分类:
其他好文 时间:
2015-01-04 13:37:21
阅读次数:
94
typedef void (*callbackFun)(int a, int b);struct exm { int type; callbackFun fun;};A pointer is a special kind of variable that holds the add...
分类:
其他好文 时间:
2015-01-04 06:25:12
阅读次数:
232
1.css文件 span.dropList {display:inline-block; height:20px;border:1px solid #ccc; cursor:pointer; background:url(../images/xj.png) #fff no-repeat center...
分类:
Web程序 时间:
2015-01-02 17:20:35
阅读次数:
310
Swap的简单实现//C语言方式(by-pointer):
template
bool swapByPointer(Type *pointer1, Type *pointer2)
{
//确保两个指针不会指向同一个对象
if (pointer1 == NULL || pointer2 == NULL)
{
return false;
}...
分类:
其他好文 时间:
2015-01-01 11:19:13
阅读次数:
195